This commit is contained in:
troy grunt 2021-04-01 22:08:16 +02:00
parent c414ec0917
commit c13739e81f

14
sql.php
View File

@ -39,20 +39,19 @@ class SQL {
foreach ( $t as $i => $c ) { foreach ( $t as $i => $c ) {
switch ($c) { switch ($c) {
case 's' : case 's' :
$v [] = "'" . mysqli_real_escape_string ( $this->h, $c ) . "'"; $v [] = "'" . mysqli_real_escape_string ( $this->h, $p [$i] ) . "'";
break; break;
case 'i' : case 'i' :
$v [] = ( int ) $c; $v [] = ( int ) $p [$i];
break; break;
case 'd' : case 'd' :
$v [] = ( double ) $c; $v [] = ( double ) $p [$i];
break; break;
default : default :
//return false; //return false;
} }
var_dump ( $q ); }
var_dump ( $t );
var_dump ( $p );
$res = array (); $res = array ();
switch (count ( $p )) { switch (count ( $p )) {
case 0 : case 0 :
@ -114,7 +113,6 @@ class SQL {
*/ */
return $res; return $res;
} }
}
public function get($que, $t = '', $p = array ()) { public function get($que, $t = '', $p = array ()) {
// echo $que; // echo $que;
$this->cnt_get ++; $this->cnt_get ++;
@ -191,7 +189,7 @@ class SQL {
if (! $res) { if (! $res) {
if (SQL_LOG) if (SQL_LOG)
fputs ( $this->f, mysqli_error () ); fputs ( $this->f, mysqli_error ( $this->h ) );
return false; return false;
} }