|
@@ -34,8 +34,7 @@ class Connector {
|
34
|
34
|
$whereClause = " $upName ";
|
35
|
35
|
foreach($value as $array) {
|
36
|
36
|
if(sizeof($array) != 3) {
|
37
|
|
- throw new Exception('Nombre de paramètres incorrect (WHERE). Les paramètres passés sont : '
|
38
|
|
- .implode(',',$array));
|
|
37
|
+ throw new Exception('wrong_arg_nmbr_where');
|
39
|
38
|
}
|
40
|
39
|
|
41
|
40
|
$whereClause .= $array[0]." ".$array[1]." :".$array[0]." AND ";
|
|
@@ -44,8 +43,7 @@ class Connector {
|
44
|
43
|
$request .= substr($whereClause, 0, -5);
|
45
|
44
|
} else if(($upName = strtoupper($name)) == "ORDER BY") {
|
46
|
45
|
if(sizeof($value) != 2 && substr($value[0], -2) != "()") {
|
47
|
|
- throw new Exception('Nombre de paramètres incorrects (ORDER BY). Les paramètres passés sont : '
|
48
|
|
- .implode(',', $value));
|
|
46
|
+ throw new Exception('wrong_arg_nmbr_order_by');
|
49
|
47
|
}
|
50
|
48
|
|
51
|
49
|
$request .= " ".$upName." ".implode(' ', $value);
|
|
@@ -57,11 +55,10 @@ class Connector {
|
57
|
55
|
// La colonne "limit" contient un index de départ et un nombre de champs
|
58
|
56
|
$request .= " $upName ".$value[0].",".$value[1];
|
59
|
57
|
} else {
|
60
|
|
- throw new Exception('Nombre de paramètres incorrects (LIMIT). Les paramètres passés sont : '
|
61
|
|
- .implode(',', $value));
|
|
58
|
+ throw new Exception('wrong_arg_numbr_limit');
|
62
|
59
|
}
|
63
|
60
|
} else {
|
64
|
|
- throw new Exception('Argument '.strtoupper($name).' inconnu');
|
|
61
|
+ throw new Exception('unknown_arg');
|
65
|
62
|
}
|
66
|
63
|
}
|
67
|
64
|
|
|
@@ -99,10 +96,9 @@ class Connector {
|
99
|
96
|
array_push($arrayVerif, $value);
|
100
|
97
|
}
|
101
|
98
|
$request = substr($request, 0, -1)." WHERE ";
|
102
|
|
- var_dump($request);
|
103
|
99
|
foreach($update['where'] as $value) {
|
104
|
100
|
$request .= $value[0].$value[1]."? AND ";
|
105
|
|
- array_push($arrayVerif, $value[2]);
|
|
101
|
+ array_push($arrayVerif, $value[2]);
|
106
|
102
|
}
|
107
|
103
|
$request = substr($request, 0, -5);
|
108
|
104
|
|