17 if (!defined(
'ADODB_DIR'))
die();
19 if (! defined(
"_ADODB_MYSQLI_LAYER")) {
20 define(
"_ADODB_MYSQLI_LAYER", 1 );
23 if (! defined(
"MYSQLI_BINARY_FLAG")) define(
"MYSQLI_BINARY_FLAG", 128);
24 if (!defined(
'MYSQLI_READ_DEFAULT_GROUP')) define(
'MYSQLI_READ_DEFAULT_GROUP',1);
27 global $ADODB_EXTENSION; $ADODB_EXTENSION =
false;
29 class ADODB_mysqli
extends ADOConnection {
30 var $databaseType =
'mysqli';
31 var $dataProvider =
'mysql';
32 var $hasInsertID =
true;
33 var $hasAffectedRows =
true;
34 var $metaTablesSQL =
"SELECT 36 CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END 37 FROM INFORMATION_SCHEMA.TABLES 39 var $metaColumnsSQL =
"SHOW COLUMNS FROM `%s`";
40 var $fmtTimeStamp =
"'Y-m-d H:i:s'";
42 var $hasMoveFirst =
true;
45 var $sysDate =
'CURDATE()';
46 var $sysTimeStamp =
'NOW()';
47 var $hasTransactions =
true;
48 var $forceNewConnect =
false;
49 var $poorAffectedRows =
true;
51 var $substr =
"substring";
54 var $_bindInputArray =
false;
56 var $optionFlags = array(array(MYSQLI_READ_DEFAULT_GROUP,0));
57 var $arrayClass =
'ADORecordSet_array_mysqli';
58 var $multiQuery =
false;
60 function ADODB_mysqli()
67 function SetTransactionMode( $transaction_mode )
69 $this->_transmode = $transaction_mode;
70 if (empty($transaction_mode)) {
71 $this->Execute(
'SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ');
74 if (!stristr($transaction_mode,
'isolation')) $transaction_mode =
'ISOLATION LEVEL '.$transaction_mode;
75 $this->Execute(
"SET SESSION TRANSACTION ".$transaction_mode);
81 function _connect($argHostname = NULL,
84 $argDatabasename = NULL, $persist=
false)
86 if(!extension_loaded(
"mysqli")) {
89 $this->_connectionID = @mysqli_init();
91 if (is_null($this->_connectionID)) {
94 ADOConnection::outp(
"mysqli_init() failed : " . $this->ErrorMsg());
102 foreach($this->optionFlags as $arr) {
103 mysqli_options($this->_connectionID,$arr[0],$arr[1]);
107 if ($persist && PHP_VERSION > 5.2 && strncmp($argHostname,
'p:',2) != 0) $argHostname =
'p:'.$argHostname;
109 #if (!empty($this->port)) $argHostname .= ":".$this->port; 110 $ok = mysqli_real_connect($this->_connectionID,
120 if ($argDatabasename)
return $this->SelectDB($argDatabasename);
124 ADOConnection::outp(
"Could't connect : " . $this->ErrorMsg());
125 $this->_connectionID = null;
132 function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
134 return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,
true);
140 function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
142 $this->forceNewConnect =
true;
143 return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
146 function IfNull( $field, $ifNull )
148 return " IFNULL($field, $ifNull) ";
152 function GetOne(
$sql,$inputarr=
false)
154 global $ADODB_GETONE_EOF;
157 $rs = $this->Execute(
$sql,$inputarr);
159 if (
$rs->EOF) $ret = $ADODB_GETONE_EOF;
160 else $ret = reset(
$rs->fields);
166 function ServerInfo()
168 $arr[
'description'] = $this->GetOne(
"select version()");
169 $arr[
'version'] = ADOConnection::_findvers($arr[
'description']);
174 function BeginTrans()
176 if ($this->transOff)
return true;
177 $this->transCnt += 1;
180 mysqli_autocommit($this->_connectionID,
false);
181 $this->Execute(
'BEGIN');
185 function CommitTrans($ok=
true)
187 if ($this->transOff)
return true;
188 if (!$ok)
return $this->RollbackTrans();
190 if ($this->transCnt) $this->transCnt -= 1;
191 $this->Execute(
'COMMIT');
194 mysqli_autocommit($this->_connectionID,
true);
198 function RollbackTrans()
200 if ($this->transOff)
return true;
201 if ($this->transCnt) $this->transCnt -= 1;
202 $this->Execute(
'ROLLBACK');
204 mysqli_autocommit($this->_connectionID,
true);
208 function RowLock($tables,$where=
'',$col=
'1 as adodbignore')
210 if ($this->transCnt==0) $this->BeginTrans();
211 if ($where) $where =
' where '.$where;
212 $rs = $this->Execute(
"select $col from $tables $where for update");
226 function qstr($s, $magic_quotes =
false)
228 if (is_null($s))
return 'NULL';
229 if (!$magic_quotes) {
230 if (PHP_VERSION >= 5)
231 return "'" . mysqli_real_escape_string($this->_connectionID, $s) .
"'";
233 if ($this->replaceQuote[0] ==
'\\')
234 $s = adodb_str_replace(array(
'\\',
"\0"),array(
'\\\\',
"\\\0"),$s);
235 return "'".str_replace(
"'",$this->replaceQuote,$s).
"'";
238 $s = str_replace(
'\\"',
'"',$s);
244 $result = @mysqli_insert_id($this->_connectionID);
246 if ($this->
debug) ADOConnection::outp(
"mysqli_insert_id() failed : " . $this->ErrorMsg());
252 function _affectedrows()
254 $result = @mysqli_affected_rows($this->_connectionID);
256 if ($this->
debug) ADOConnection::outp(
"mysqli_affected_rows() failed : " . $this->ErrorMsg());
263 var $_genIDSQL =
"update %s set id=LAST_INSERT_ID(id+1);";
264 var $_genSeqSQL =
"create table %s (id int not null)";
265 var $_genSeqCountSQL =
"select count(*) from %s";
266 var $_genSeq2SQL =
"insert into %s values (%s)";
267 var $_dropSeqSQL =
"drop table %s";
269 function CreateSequence($seqname=
'adodbseq',$startID=1)
271 if (empty($this->_genSeqSQL))
return false;
272 $u = strtoupper($seqname);
274 $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
275 if (!$ok)
return false;
276 return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
279 function GenID($seqname=
'adodbseq',$startID=1)
282 if (!$this->hasGenID)
return false;
284 $getnext = sprintf($this->_genIDSQL,$seqname);
285 $holdtransOK = $this->_transOK;
286 $rs = @$this->Execute($getnext);
288 if ($holdtransOK) $this->_transOK =
true;
289 $u = strtoupper($seqname);
290 $this->Execute(sprintf($this->_genSeqSQL,$seqname));
291 $cnt = $this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
292 if (!$cnt) $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
293 $rs = $this->Execute($getnext);
297 $this->genID = mysqli_insert_id($this->_connectionID);
305 function MetaDatabases()
307 $query =
"SHOW DATABASES";
308 $ret = $this->Execute($query);
309 if ($ret && is_object($ret)){
312 $db = $ret->Fields(
'Database');
313 if ($db !=
'mysql') $arr[] = $db;
322 function MetaIndexes ($table, $primary = FALSE, $owner =
false)
325 global $ADODB_FETCH_MODE;
328 $save = $ADODB_FETCH_MODE;
329 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
330 if ($this->fetchMode !== FALSE) {
331 $savem = $this->SetFetchMode(FALSE);
335 $rs = $this->Execute(sprintf(
'SHOW INDEXES FROM %s',$table));
339 $this->SetFetchMode($savem);
341 $ADODB_FETCH_MODE = $save;
343 if (!is_object(
$rs)) {
350 while ($row =
$rs->FetchRow()) {
351 if ($primary == FALSE AND $row[2] ==
'PRIMARY') {
355 if (!isset($indexes[$row[2]])) {
356 $indexes[$row[2]] = array(
357 'unique' => ($row[1] == 0),
362 $indexes[$row[2]][
'columns'][$row[3] - 1] = $row[4];
366 foreach ( array_keys ($indexes) as $index )
368 ksort ($indexes[$index][
'columns']);
376 function SQLDate($fmt, $col=
false)
378 if (!$col) $col = $this->sysTimeStamp;
379 $s =
'DATE_FORMAT('.$col.
",'";
382 for ($i=0; $i < $len; $i++) {
391 $s .=
"'),Quarter($col)";
393 if ($len > $i+1) $s .=
",DATE_FORMAT($col,'";
442 $ch = substr($fmt,$i,1);
449 if ($concat) $s =
"CONCAT($s)";
458 $arr = func_get_args();
461 $s = implode(
',',$arr);
462 if (strlen($s) > 0)
return "CONCAT($s)";
467 function OffsetDate($dayFraction,$date=
false)
469 if (!$date) $date = $this->sysDate;
471 $fraction = $dayFraction * 24 * 3600;
472 return $date .
' + INTERVAL ' . $fraction.
' SECOND';
477 function MetaProcedures($NamePattern =
false, $catalog = null, $schemaPattern = null)
480 global $ADODB_FETCH_MODE;
483 $save = $ADODB_FETCH_MODE;
484 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
486 if ($this->fetchMode !== FALSE) {
487 $savem = $this->SetFetchMode(FALSE);
490 $procedures = array ();
496 $likepattern =
" LIKE '".$NamePattern.
"'";
498 $rs = $this->Execute(
'SHOW PROCEDURE STATUS'.$likepattern);
499 if (is_object(
$rs)) {
502 while ($row =
$rs->FetchRow()) {
503 $procedures[$row[1]] = array(
504 'type' =>
'PROCEDURE',
508 'remarks' => $row[7],
513 $rs = $this->Execute(
'SHOW FUNCTION STATUS'.$likepattern);
514 if (is_object(
$rs)) {
516 while ($row =
$rs->FetchRow()) {
517 $procedures[$row[1]] = array(
518 'type' =>
'FUNCTION',
528 $this->SetFetchMode($savem);
531 $ADODB_FETCH_MODE = $save;
546 function MetaTables($ttype=
false,$showSchema=
false,$mask=
false)
548 $save = $this->metaTablesSQL;
549 if ($showSchema && is_string($showSchema)) {
550 $this->metaTablesSQL .= $this->qstr($showSchema);
552 $this->metaTablesSQL .=
"schema()";
556 $mask = $this->qstr($mask);
557 $this->metaTablesSQL .=
" AND table_name LIKE $mask";
559 $ret = ADOConnection::MetaTables($ttype,$showSchema);
561 $this->metaTablesSQL = $save;
566 function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
568 global $ADODB_FETCH_MODE;
570 if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative =
true;
572 if ( !empty($owner) ) {
573 $table =
"$owner.$table";
575 $a_create_table = $this->getRow(sprintf(
'SHOW CREATE TABLE %s', $table));
577 $create_sql = isset($a_create_table[
"Create Table"]) ? $a_create_table[
"Create Table"] : $a_create_table[
"Create View"];
578 }
else $create_sql = $a_create_table[1];
582 if (!preg_match_all(
"/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches))
return false;
583 $foreign_keys = array();
584 $num_keys = count($matches[0]);
585 for ( $i = 0; $i < $num_keys; $i ++ ) {
586 $my_field = explode(
'`, `', $matches[1][$i]);
587 $ref_table = $matches[2][$i];
588 $ref_field = explode(
'`, `', $matches[3][$i]);
591 $ref_table = strtoupper($ref_table);
595 if (!isset($foreign_keys[$ref_table])) {
596 $foreign_keys[$ref_table] = array();
598 $num_fields = count($my_field);
599 for ( $j = 0; $j < $num_fields; $j ++ ) {
600 if ( $associative ) {
601 $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
603 $foreign_keys[$ref_table][] =
"{$my_field[$j]}={$ref_field[$j]}";
608 return $foreign_keys;
611 function MetaColumns($table, $normalize=
true)
614 if (!$this->metaColumnsSQL)
617 global $ADODB_FETCH_MODE;
618 $save = $ADODB_FETCH_MODE;
619 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
620 if ($this->fetchMode !==
false)
621 $savem = $this->SetFetchMode(
false);
622 $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
623 if (isset($savem)) $this->SetFetchMode($savem);
624 $ADODB_FETCH_MODE = $save;
630 $fld =
new ADOFieldObject();
631 $fld->name =
$rs->fields[0];
632 $type =
$rs->fields[1];
636 if (preg_match(
"/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
637 $fld->type = $query_array[1];
638 $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
639 $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
640 } elseif (preg_match(
"/^(.+)\((\d+)/", $type, $query_array)) {
641 $fld->type = $query_array[1];
642 $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
643 } elseif (preg_match(
"/^(enum)\((.*)\)$/i", $type, $query_array)) {
644 $fld->type = $query_array[1];
645 $arr = explode(
",",$query_array[2]);
647 $zlen = max(array_map(
"strlen",$arr)) - 2;
648 $fld->max_length = ($zlen > 0) ? $zlen : 1;
651 $fld->max_length = -1;
653 $fld->not_null = (
$rs->fields[2] !=
'YES');
654 $fld->primary_key = (
$rs->fields[3] ==
'PRI');
655 $fld->auto_increment = (strpos(
$rs->fields[5],
'auto_increment') !==
false);
656 $fld->binary = (strpos($type,
'blob') !==
false);
657 $fld->unsigned = (strpos($type,
'unsigned') !==
false);
658 $fld->zerofill = (strpos($type,
'zerofill') !==
false);
662 if ($d !=
'' && $d !=
'NULL') {
663 $fld->has_default =
true;
664 $fld->default_value = $d;
666 $fld->has_default =
false;
670 if ($save == ADODB_FETCH_NUM) {
673 $retarr[strtoupper($fld->name)] = $fld;
683 function SelectDB($dbName)
686 $this->database = $dbName;
687 $this->databaseName = $dbName; # obsolete, retained
for compat with older adodb versions
689 if ($this->_connectionID) {
690 $result = @mysqli_select_db($this->_connectionID, $dbName);
692 ADOConnection::outp(
"Select of database " . $dbName .
" failed. " . $this->ErrorMsg());
700 function SelectLimit(
$sql,
706 $offsetStr = ($offset >= 0) ?
"$offset," :
'';
707 if ($nrows < 0) $nrows =
'18446744073709551615';
710 $rs = $this->CacheExecute($secs,
$sql .
" LIMIT $offsetStr$nrows" , $inputarr );
712 $rs = $this->Execute(
$sql .
" LIMIT $offsetStr$nrows" , $inputarr );
718 function Prepare(
$sql)
721 $stmt = $this->_connectionID->prepare(
$sql);
723 echo $this->ErrorMsg();
726 return array(
$sql,$stmt);
731 function _query(
$sql, $inputarr)
733 global $ADODB_COUNTRECS;
741 if (is_array(
$sql)) {
748 foreach($inputarr as $k => $v) {
749 if (is_string($v)) $a .=
's';
750 else if (is_integer($v)) $a .=
'i';
754 $fnarr = array_merge( array($stmt,$a) , $inputarr);
755 $ret = call_user_func_array(
'mysqli_stmt_bind_param',$fnarr);
756 $ret = mysqli_stmt_execute($stmt);
769 if ($this->multiQuery) {
770 $rs = mysqli_multi_query($this->_connectionID,
$sql.
';');
772 $rs = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->_connectionID ) : @mysqli_use_result( $this->_connectionID );
776 $rs = mysqli_query($this->_connectionID,
$sql, $ADODB_COUNTRECS ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
782 ADOConnection::outp(
"Query: " .
$sql .
" failed. " . $this->ErrorMsg());
791 if (empty($this->_connectionID))
792 $this->_errorMsg = @mysqli_connect_error();
794 $this->_errorMsg = @mysqli_error($this->_connectionID);
795 return $this->_errorMsg;
801 if (empty($this->_connectionID))
802 return @mysqli_connect_errno();
804 return @mysqli_errno($this->_connectionID);
810 @mysqli_close($this->_connectionID);
811 $this->_connectionID =
false;
839 function GetCharSet()
842 if (!method_exists($this->_connectionID,
'character_set_name'))
845 $this->charSet = @$this->_connectionID->character_set_name();
846 if (!$this->charSet) {
849 return $this->charSet;
854 function SetCharSet($charset_name)
856 if (!method_exists($this->_connectionID,
'set_charset'))
859 if ($this->charSet !== $charset_name) {
860 $if = @$this->_connectionID->set_charset($charset_name);
861 if ($if ===
true & $this->GetCharSet() == $charset_name) {
876 class ADORecordSet_mysqli
extends ADORecordSet{
878 var $databaseType =
"mysqli";
881 function ADORecordSet_mysqli($queryID, $mode =
false)
885 global $ADODB_FETCH_MODE;
886 $mode = $ADODB_FETCH_MODE;
891 case ADODB_FETCH_NUM:
892 $this->fetchMode = MYSQLI_NUM;
894 case ADODB_FETCH_ASSOC:
895 $this->fetchMode = MYSQLI_ASSOC;
897 case ADODB_FETCH_DEFAULT:
898 case ADODB_FETCH_BOTH:
900 $this->fetchMode = MYSQLI_BOTH;
903 $this->adodbFetchMode = $mode;
904 $this->ADORecordSet($queryID);
909 global $ADODB_COUNTRECS;
911 $this->_numOfRows = $ADODB_COUNTRECS ? @mysqli_num_rows($this->_queryID) : -1;
912 $this->_numOfFields = @mysqli_num_fields($this->_queryID);
935 function FetchField($fieldOffset = -1)
937 $fieldnr = $fieldOffset;
938 if ($fieldOffset != -1) {
939 $fieldOffset = @mysqli_field_seek($this->_queryID, $fieldnr);
941 $o = @mysqli_fetch_field($this->_queryID);
942 if (!$o)
return false;
944 $o->primary_key = $o->flags & MYSQLI_PRI_KEY_FLAG;
945 $o->not_null = $o->flags & MYSQLI_NOT_NULL_FLAG;
946 $o->auto_increment = $o->flags & MYSQLI_AUTO_INCREMENT_FLAG;
947 $o->binary = $o->flags & MYSQLI_BINARY_FLAG;
949 $o->unsigned = $o->flags & MYSQLI_UNSIGNED_FLAG;
954 function GetRowAssoc($upper =
true)
956 if ($this->fetchMode == MYSQLI_ASSOC && !$upper)
957 return $this->fields;
958 $row = ADORecordSet::GetRowAssoc($upper);
963 function Fields($colname)
965 if ($this->fetchMode != MYSQLI_NUM)
966 return @$this->fields[$colname];
969 $this->bind = array();
970 for ($i = 0; $i < $this->_numOfFields; $i++) {
971 $o = $this->FetchField($i);
972 $this->bind[strtoupper($o->name)] = $i;
975 return $this->fields[$this->bind[strtoupper($colname)]];
980 if ($this->_numOfRows == 0)
986 mysqli_data_seek($this->_queryID, $row);
992 function NextRecordSet()
994 global $ADODB_COUNTRECS;
996 mysqli_free_result($this->_queryID);
997 $this->_queryID = -1;
1002 if(!mysqli_next_result($this->connection->_connectionID)) {
1006 $this->_queryID = ($ADODB_COUNTRECS) ? @mysqli_store_result( $this->connection->_connectionID )
1007 : @mysqli_use_result( $this->connection->_connectionID );
1008 if(!$this->_queryID) {
1011 $this->_inited =
false;
1012 $this->bind =
false;
1013 $this->_currentRow = -1;
1023 if ($this->EOF)
return false;
1024 $this->_currentRow++;
1025 $this->fields = @mysqli_fetch_array($this->_queryID,$this->fetchMode);
1027 if (is_array($this->fields))
return true;
1034 $this->fields = mysqli_fetch_array($this->_queryID,$this->fetchMode);
1035 return is_array($this->fields);
1043 while(mysqli_more_results($this->connection->_connectionID)){
1044 @mysqli_next_result($this->connection->_connectionID);
1047 mysqli_free_result($this->_queryID);
1048 $this->_queryID =
false;
1080 function MetaType($t, $len = -1, $fieldobj =
false)
1082 if (is_object($t)) {
1084 $t = $fieldobj->type;
1085 $len = $fieldobj->max_length;
1090 switch (strtoupper($t)) {
1099 case MYSQLI_TYPE_TINY_BLOB :
1100 #case MYSQLI_TYPE_CHAR : 1101 case MYSQLI_TYPE_STRING :
1102 case MYSQLI_TYPE_ENUM :
1103 case MYSQLI_TYPE_SET :
1105 if ($len <= $this->blobSize)
return 'C';
1120 case MYSQLI_TYPE_BLOB :
1121 case MYSQLI_TYPE_LONG_BLOB :
1122 case MYSQLI_TYPE_MEDIUM_BLOB :
1124 return !empty($fieldobj->binary) ?
'B' :
'X';
1127 case MYSQLI_TYPE_DATE :
1128 case MYSQLI_TYPE_YEAR :
1136 case MYSQLI_TYPE_DATETIME :
1137 case MYSQLI_TYPE_NEWDATE :
1138 case MYSQLI_TYPE_TIME :
1139 case MYSQLI_TYPE_TIMESTAMP :
1150 case MYSQLI_TYPE_INT24 :
1151 case MYSQLI_TYPE_LONG :
1152 case MYSQLI_TYPE_LONGLONG :
1153 case MYSQLI_TYPE_SHORT :
1154 case MYSQLI_TYPE_TINY :
1156 if (!empty($fieldobj->primary_key))
return 'R';
1184 $this->ADORecordSet_array($id,$mode);
1189 if (is_object($t)) {
1191 $t = $fieldobj->type;
1192 $len = $fieldobj->max_length;
1197 switch (strtoupper($t)) {
1206 case MYSQLI_TYPE_TINY_BLOB :
1207 #case MYSQLI_TYPE_CHAR : 1208 case MYSQLI_TYPE_STRING :
1209 case MYSQLI_TYPE_ENUM :
1210 case MYSQLI_TYPE_SET :
1212 if ($len <= $this->blobSize)
return 'C';
1227 case MYSQLI_TYPE_BLOB :
1228 case MYSQLI_TYPE_LONG_BLOB :
1229 case MYSQLI_TYPE_MEDIUM_BLOB :
1231 return !empty($fieldobj->binary) ?
'B' :
'X';
1234 case MYSQLI_TYPE_DATE :
1235 case MYSQLI_TYPE_YEAR :
1243 case MYSQLI_TYPE_DATETIME :
1244 case MYSQLI_TYPE_NEWDATE :
1245 case MYSQLI_TYPE_TIME :
1246 case MYSQLI_TYPE_TIMESTAMP :
1257 case MYSQLI_TYPE_INT24 :
1258 case MYSQLI_TYPE_LONG :
1259 case MYSQLI_TYPE_LONGLONG :
1260 case MYSQLI_TYPE_SHORT :
1261 case MYSQLI_TYPE_TINY :
1263 if (!empty($fieldobj->primary_key))
return 'R';
ADORecordSet_array_mysqli($id=-1, $mode=false)
MetaType($t, $len=-1, $fieldobj=false)
if(isset($_REQUEST['nrows'])) else $rs
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
debug($variable='', $name=' *variable *', $line=' *line *', $file=' *file *', $recursiveDepth=3, $debugLevel=E_DEBUG)