new approach to logging database access and upgraded adodb
[openemr.git] / library / adodb / drivers / adodb-mysql.inc.php
blob8252b671f20764d721743a242ea67ec6545000a1
1 <?php
2 /*
3 V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
4 Released under both BSD license and Lesser GPL library license.
5 Whenever there is any discrepancy between the two licenses,
6 the BSD license will take precedence.
7 Set tabs to 8.
9 MySQL code that does not support transactions. Use mysqlt if you need transactions.
10 Requires mysql client. Works on Windows and Unix.
12 28 Feb 2001: MetaColumns bug fix - suggested by Freek Dijkstra (phpeverywhere@macfreek.com)
13 */
15 // security - hide paths
16 if (!defined('ADODB_DIR')) die();
18 if (! defined("_ADODB_MYSQL_LAYER")) {
19 define("_ADODB_MYSQL_LAYER", 1 );
21 class ADODB_mysql extends ADOConnection {
22 var $databaseType = 'mysql';
23 var $dataProvider = 'mysql';
24 var $hasInsertID = true;
25 var $hasAffectedRows = true;
26 var $metaTablesSQL = "SHOW TABLES";
27 var $metaColumnsSQL = "SHOW COLUMNS FROM `%s`";
28 var $fmtTimeStamp = "'Y-m-d H:i:s'";
29 var $hasLimit = true;
30 var $hasMoveFirst = true;
31 var $hasGenID = true;
32 var $isoDates = true; // accepts dates in ISO format
33 var $sysDate = 'CURDATE()';
34 var $sysTimeStamp = 'NOW()';
35 var $hasTransactions = false;
36 var $forceNewConnect = false;
37 var $poorAffectedRows = true;
38 var $clientFlags = 0;
39 var $substr = "substring";
40 var $nameQuote = '`'; /// string to use to quote identifiers and names
41 var $compat323 = false; // true if compat with mysql 3.23
43 function ADODB_mysql()
45 if (defined('ADODB_EXTENSION')) $this->rsPrefix .= 'ext_';
48 function ServerInfo()
50 $arr['description'] = ADOConnection::GetOne("select version()");
51 $arr['version'] = ADOConnection::_findvers($arr['description']);
52 return $arr;
55 function IfNull( $field, $ifNull )
57 return " IFNULL($field, $ifNull) "; // if MySQL
61 function MetaTables($ttype=false,$showSchema=false,$mask=false)
63 $save = $this->metaTablesSQL;
64 if ($showSchema && is_string($showSchema)) {
65 $this->metaTablesSQL .= " from $showSchema";
68 if ($mask) {
69 $mask = $this->qstr($mask);
70 $this->metaTablesSQL .= " like $mask";
72 $ret = ADOConnection::MetaTables($ttype,$showSchema);
74 $this->metaTablesSQL = $save;
75 return $ret;
79 function MetaIndexes ($table, $primary = FALSE, $owner=false)
81 // save old fetch mode
82 global $ADODB_FETCH_MODE;
84 $false = false;
85 $save = $ADODB_FETCH_MODE;
86 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
87 if ($this->fetchMode !== FALSE) {
88 $savem = $this->SetFetchMode(FALSE);
91 // get index details
92 $rs = $this->Execute(sprintf('SHOW INDEX FROM %s',$table));
94 // restore fetchmode
95 if (isset($savem)) {
96 $this->SetFetchMode($savem);
98 $ADODB_FETCH_MODE = $save;
100 if (!is_object($rs)) {
101 return $false;
104 $indexes = array ();
106 // parse index data into array
107 while ($row = $rs->FetchRow()) {
108 if ($primary == FALSE AND $row[2] == 'PRIMARY') {
109 continue;
112 if (!isset($indexes[$row[2]])) {
113 $indexes[$row[2]] = array(
114 'unique' => ($row[1] == 0),
115 'columns' => array()
119 $indexes[$row[2]]['columns'][$row[3] - 1] = $row[4];
122 // sort columns by order in the index
123 foreach ( array_keys ($indexes) as $index )
125 ksort ($indexes[$index]['columns']);
128 return $indexes;
132 // if magic quotes disabled, use mysql_real_escape_string()
133 function qstr($s,$magic_quotes=false)
135 if (is_null($s)) return 'NULL';
136 if (!$magic_quotes) {
138 if (ADODB_PHPVER >= 0x4300) {
139 if (is_resource($this->_connectionID))
140 return "'".mysql_real_escape_string($s,$this->_connectionID)."'";
142 if ($this->replaceQuote[0] == '\\'){
143 $s = adodb_str_replace(array('\\',"\0"),array('\\\\',"\\\0"),$s);
145 return "'".str_replace("'",$this->replaceQuote,$s)."'";
148 // undo magic quotes for "
149 $s = str_replace('\\"','"',$s);
150 return "'$s'";
153 function _insertid()
155 return ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
156 //return mysql_insert_id($this->_connectionID);
159 function GetOne($sql,$inputarr=false)
161 global $ADODB_GETONE_EOF;
162 if ($this->compat323 == false && strncasecmp($sql,'sele',4) == 0) {
163 $rs = $this->SelectLimit($sql,1,-1,$inputarr);
164 if ($rs) {
165 $rs->Close();
166 if ($rs->EOF) return $ADODB_GETONE_EOF;
167 return reset($rs->fields);
169 } else {
170 return ADOConnection::GetOne($sql,$inputarr);
172 return false;
175 function BeginTrans()
177 if ($this->debug) ADOConnection::outp("Transactions not supported in 'mysql' driver. Use 'mysqlt' or 'mysqli' driver");
180 function _affectedrows()
182 return mysql_affected_rows($this->_connectionID);
185 // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
186 // Reference on Last_Insert_ID on the recommended way to simulate sequences
187 var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
188 var $_genSeqSQL = "create table %s (id int not null)";
189 var $_genSeqCountSQL = "select count(*) from %s";
190 var $_genSeq2SQL = "insert into %s values (%s)";
191 var $_dropSeqSQL = "drop table %s";
193 function CreateSequence($seqname='adodbseq',$startID=1)
195 if (empty($this->_genSeqSQL)) return false;
196 $u = strtoupper($seqname);
198 $ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
199 if (!$ok) return false;
200 return $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
204 function GenID($seqname='adodbseq',$startID=1)
206 // post-nuke sets hasGenID to false
207 if (!$this->hasGenID) return false;
209 $savelog = $this->_logsql;
210 $this->_logsql = false;
211 $getnext = sprintf($this->_genIDSQL,$seqname);
212 $holdtransOK = $this->_transOK; // save the current status
213 $rs = @$this->Execute($getnext);
214 if (!$rs) {
215 if ($holdtransOK) $this->_transOK = true; //if the status was ok before reset
216 $u = strtoupper($seqname);
217 $this->Execute(sprintf($this->_genSeqSQL,$seqname));
218 $cnt = $this->GetOne(sprintf($this->_genSeqCountSQL,$seqname));
219 if (!$cnt) $this->Execute(sprintf($this->_genSeq2SQL,$seqname,$startID-1));
220 $rs = $this->Execute($getnext);
223 if ($rs) {
224 $this->genID = mysql_insert_id($this->_connectionID);
225 $rs->Close();
226 } else
227 $this->genID = 0;
229 $this->_logsql = $savelog;
230 return $this->genID;
233 function MetaDatabases()
235 $qid = mysql_list_dbs($this->_connectionID);
236 $arr = array();
237 $i = 0;
238 $max = mysql_num_rows($qid);
239 while ($i < $max) {
240 $db = mysql_tablename($qid,$i);
241 if ($db != 'mysql') $arr[] = $db;
242 $i += 1;
244 return $arr;
248 // Format date column in sql string given an input format that understands Y M D
249 function SQLDate($fmt, $col=false)
251 if (!$col) $col = $this->sysTimeStamp;
252 $s = 'DATE_FORMAT('.$col.",'";
253 $concat = false;
254 $len = strlen($fmt);
255 for ($i=0; $i < $len; $i++) {
256 $ch = $fmt[$i];
257 switch($ch) {
259 default:
260 if ($ch == '\\') {
261 $i++;
262 $ch = substr($fmt,$i,1);
264 /** FALL THROUGH */
265 case '-':
266 case '/':
267 $s .= $ch;
268 break;
270 case 'Y':
271 case 'y':
272 $s .= '%Y';
273 break;
274 case 'M':
275 $s .= '%b';
276 break;
278 case 'm':
279 $s .= '%m';
280 break;
281 case 'D':
282 case 'd':
283 $s .= '%d';
284 break;
286 case 'Q':
287 case 'q':
288 $s .= "'),Quarter($col)";
290 if ($len > $i+1) $s .= ",DATE_FORMAT($col,'";
291 else $s .= ",('";
292 $concat = true;
293 break;
295 case 'H':
296 $s .= '%H';
297 break;
299 case 'h':
300 $s .= '%I';
301 break;
303 case 'i':
304 $s .= '%i';
305 break;
307 case 's':
308 $s .= '%s';
309 break;
311 case 'a':
312 case 'A':
313 $s .= '%p';
314 break;
316 case 'w':
317 $s .= '%w';
318 break;
320 case 'W':
321 $s .= '%U';
322 break;
324 case 'l':
325 $s .= '%W';
326 break;
329 $s.="')";
330 if ($concat) $s = "CONCAT($s)";
331 return $s;
335 // returns concatenated string
336 // much easier to run "mysqld --ansi" or "mysqld --sql-mode=PIPES_AS_CONCAT" and use || operator
337 function Concat()
339 $s = "";
340 $arr = func_get_args();
342 // suggestion by andrew005@mnogo.ru
343 $s = implode(',',$arr);
344 if (strlen($s) > 0) return "CONCAT($s)";
345 else return '';
348 function OffsetDate($dayFraction,$date=false)
350 if (!$date) $date = $this->sysDate;
352 $fraction = $dayFraction * 24 * 3600;
353 return '('. $date . ' + INTERVAL ' . $fraction.' SECOND)';
355 // return "from_unixtime(unix_timestamp($date)+$fraction)";
358 // returns true or false
359 function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
361 if (!empty($this->port)) $argHostname .= ":".$this->port;
363 if (ADODB_PHPVER >= 0x4300)
364 $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
365 $this->forceNewConnect,$this->clientFlags);
366 else if (ADODB_PHPVER >= 0x4200)
367 $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
368 $this->forceNewConnect);
369 else
370 $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
372 if ($this->_connectionID === false) return false;
373 if ($argDatabasename) return $this->SelectDB($argDatabasename);
374 return true;
377 // returns true or false
378 function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
380 if (!empty($this->port)) $argHostname .= ":".$this->port;
382 if (ADODB_PHPVER >= 0x4300)
383 $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword,$this->clientFlags);
384 else
385 $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
386 if ($this->_connectionID === false) return false;
387 if ($this->autoRollback) $this->RollbackTrans();
388 if ($argDatabasename) return $this->SelectDB($argDatabasename);
389 return true;
392 function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
394 $this->forceNewConnect = true;
395 return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
398 function MetaColumns($table, $normalize=true)
400 $this->_findschema($table,$schema);
401 if ($schema) {
402 $dbName = $this->database;
403 $this->SelectDB($schema);
405 global $ADODB_FETCH_MODE;
406 $save = $ADODB_FETCH_MODE;
407 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
409 if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
410 $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
412 if ($schema) {
413 $this->SelectDB($dbName);
416 if (isset($savem)) $this->SetFetchMode($savem);
417 $ADODB_FETCH_MODE = $save;
418 if (!is_object($rs)) {
419 $false = false;
420 return $false;
423 $retarr = array();
424 while (!$rs->EOF){
425 $fld = new ADOFieldObject();
426 $fld->name = $rs->fields[0];
427 $type = $rs->fields[1];
429 // split type into type(length):
430 $fld->scale = null;
431 if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
432 $fld->type = $query_array[1];
433 $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
434 $fld->scale = is_numeric($query_array[3]) ? $query_array[3] : -1;
435 } elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
436 $fld->type = $query_array[1];
437 $fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : -1;
438 } elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
439 $fld->type = $query_array[1];
440 $arr = explode(",",$query_array[2]);
441 $fld->enums = $arr;
442 $zlen = max(array_map("strlen",$arr)) - 2; // PHP >= 4.0.6
443 $fld->max_length = ($zlen > 0) ? $zlen : 1;
444 } else {
445 $fld->type = $type;
446 $fld->max_length = -1;
448 $fld->not_null = ($rs->fields[2] != 'YES');
449 $fld->primary_key = ($rs->fields[3] == 'PRI');
450 $fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
451 $fld->binary = (strpos($type,'blob') !== false || strpos($type,'binary') !== false);
452 $fld->unsigned = (strpos($type,'unsigned') !== false);
453 $fld->zerofill = (strpos($type,'zerofill') !== false);
455 if (!$fld->binary) {
456 $d = $rs->fields[4];
457 if ($d != '' && $d != 'NULL') {
458 $fld->has_default = true;
459 $fld->default_value = $d;
460 } else {
461 $fld->has_default = false;
465 if ($save == ADODB_FETCH_NUM) {
466 $retarr[] = $fld;
467 } else {
468 $retarr[strtoupper($fld->name)] = $fld;
470 $rs->MoveNext();
473 $rs->Close();
474 return $retarr;
477 // returns true or false
478 function SelectDB($dbName)
480 $this->database = $dbName;
481 $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions
482 if ($this->_connectionID) {
483 return @mysql_select_db($dbName,$this->_connectionID);
485 else return false;
488 // parameters use PostgreSQL convention, not MySQL
489 function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs=0)
491 $offsetStr =($offset>=0) ? ((integer)$offset)."," : '';
492 // jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
493 if ($nrows < 0) $nrows = '18446744073709551615';
495 if ($secs)
496 $rs = $this->CacheExecute($secs,$sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
497 else
498 $rs = $this->Execute($sql." LIMIT $offsetStr".((integer)$nrows),$inputarr);
499 return $rs;
502 // returns queryID or false
503 function _query($sql,$inputarr=false)
505 //global $ADODB_COUNTRECS;
506 //if($ADODB_COUNTRECS)
507 return mysql_query($sql,$this->_connectionID);
508 //else return @mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
511 /* Returns: the last error message from previous database operation */
512 function ErrorMsg()
515 if ($this->_logsql) return $this->_errorMsg;
516 if (empty($this->_connectionID)) $this->_errorMsg = @mysql_error();
517 else $this->_errorMsg = @mysql_error($this->_connectionID);
518 return $this->_errorMsg;
521 /* Returns: the last error number from previous database operation */
522 function ErrorNo()
524 if ($this->_logsql) return $this->_errorCode;
525 if (empty($this->_connectionID)) return @mysql_errno();
526 else return @mysql_errno($this->_connectionID);
529 // returns true or false
530 function _close()
532 @mysql_close($this->_connectionID);
533 $this->_connectionID = false;
538 * Maximum size of C field
540 function CharMax()
542 return 255;
546 * Maximum size of X field
548 function TextMax()
550 return 4294967295;
553 // "Innox - Juan Carlos Gonzalez" <jgonzalez#innox.com.mx>
554 function MetaForeignKeys( $table, $owner = FALSE, $upper = FALSE, $associative = FALSE )
556 global $ADODB_FETCH_MODE;
557 if ($ADODB_FETCH_MODE == ADODB_FETCH_ASSOC || $this->fetchMode == ADODB_FETCH_ASSOC) $associative = true;
559 if ( !empty($owner) ) {
560 $table = "$owner.$table";
562 $a_create_table = $this->getRow(sprintf('SHOW CREATE TABLE %s', $table));
563 if ($associative) {
564 $create_sql = isset($a_create_table["Create Table"]) ? $a_create_table["Create Table"] : $a_create_table["Create View"];
565 } else $create_sql = $a_create_table[1];
567 $matches = array();
569 if (!preg_match_all("/FOREIGN KEY \(`(.*?)`\) REFERENCES `(.*?)` \(`(.*?)`\)/", $create_sql, $matches)) return false;
570 $foreign_keys = array();
571 $num_keys = count($matches[0]);
572 for ( $i = 0; $i < $num_keys; $i ++ ) {
573 $my_field = explode('`, `', $matches[1][$i]);
574 $ref_table = $matches[2][$i];
575 $ref_field = explode('`, `', $matches[3][$i]);
577 if ( $upper ) {
578 $ref_table = strtoupper($ref_table);
581 // see https://sourceforge.net/tracker/index.php?func=detail&aid=2287278&group_id=42718&atid=433976
582 if (!isset($foreign_keys[$ref_table])) {
583 $foreign_keys[$ref_table] = array();
585 $num_fields = count($my_field);
586 for ( $j = 0; $j < $num_fields; $j ++ ) {
587 if ( $associative ) {
588 $foreign_keys[$ref_table][$ref_field[$j]] = $my_field[$j];
589 } else {
590 $foreign_keys[$ref_table][] = "{$my_field[$j]}={$ref_field[$j]}";
595 return $foreign_keys;
601 /*--------------------------------------------------------------------------------------
602 Class Name: Recordset
603 --------------------------------------------------------------------------------------*/
606 class ADORecordSet_mysql extends ADORecordSet{
608 var $databaseType = "mysql";
609 var $canSeek = true;
611 function ADORecordSet_mysql($queryID,$mode=false)
613 if ($mode === false) {
614 global $ADODB_FETCH_MODE;
615 $mode = $ADODB_FETCH_MODE;
617 switch ($mode)
619 case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
620 case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
621 case ADODB_FETCH_DEFAULT:
622 case ADODB_FETCH_BOTH:
623 default:
624 $this->fetchMode = MYSQL_BOTH; break;
626 $this->adodbFetchMode = $mode;
627 $this->ADORecordSet($queryID);
630 function _initrs()
632 //GLOBAL $ADODB_COUNTRECS;
633 // $this->_numOfRows = ($ADODB_COUNTRECS) ? @mysql_num_rows($this->_queryID):-1;
634 $this->_numOfRows = @mysql_num_rows($this->_queryID);
635 $this->_numOfFields = @mysql_num_fields($this->_queryID);
638 function FetchField($fieldOffset = -1)
640 if ($fieldOffset != -1) {
641 $o = @mysql_fetch_field($this->_queryID, $fieldOffset);
642 $f = @mysql_field_flags($this->_queryID,$fieldOffset);
643 if ($o) $o->max_length = @mysql_field_len($this->_queryID,$fieldOffset); // suggested by: Jim Nicholson (jnich#att.com)
644 //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
645 if ($o) $o->binary = (strpos($f,'binary')!== false);
647 else if ($fieldOffset == -1) { /* The $fieldOffset argument is not provided thus its -1 */
648 $o = @mysql_fetch_field($this->_queryID);
649 if ($o) $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich#att.com)
650 //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
653 return $o;
656 function GetRowAssoc($upper=true)
658 if ($this->fetchMode == MYSQL_ASSOC && !$upper) $row = $this->fields;
659 else $row = ADORecordSet::GetRowAssoc($upper);
660 return $row;
663 /* Use associative array to get fields array */
664 function Fields($colname)
666 // added @ by "Michael William Miller" <mille562@pilot.msu.edu>
667 if ($this->fetchMode != MYSQL_NUM) return @$this->fields[$colname];
669 if (!$this->bind) {
670 $this->bind = array();
671 for ($i=0; $i < $this->_numOfFields; $i++) {
672 $o = $this->FetchField($i);
673 $this->bind[strtoupper($o->name)] = $i;
676 return $this->fields[$this->bind[strtoupper($colname)]];
679 function _seek($row)
681 if ($this->_numOfRows == 0) return false;
682 return @mysql_data_seek($this->_queryID,$row);
685 function MoveNext()
687 //return adodb_movenext($this);
688 //if (defined('ADODB_EXTENSION')) return adodb_movenext($this);
689 if (@$this->fields = mysql_fetch_array($this->_queryID,$this->fetchMode)) {
690 $this->_currentRow += 1;
691 return true;
693 if (!$this->EOF) {
694 $this->_currentRow += 1;
695 $this->EOF = true;
697 return false;
700 function _fetch()
702 $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode);
703 return is_array($this->fields);
706 function _close() {
707 @mysql_free_result($this->_queryID);
708 $this->_queryID = false;
711 function MetaType($t,$len=-1,$fieldobj=false)
713 if (is_object($t)) {
714 $fieldobj = $t;
715 $t = $fieldobj->type;
716 $len = $fieldobj->max_length;
719 $len = -1; // mysql max_length is not accurate
720 switch (strtoupper($t)) {
721 case 'STRING':
722 case 'CHAR':
723 case 'VARCHAR':
724 case 'TINYBLOB':
725 case 'TINYTEXT':
726 case 'ENUM':
727 case 'SET':
728 if ($len <= $this->blobSize) return 'C';
730 case 'TEXT':
731 case 'LONGTEXT':
732 case 'MEDIUMTEXT':
733 return 'X';
735 // php_mysql extension always returns 'blob' even if 'text'
736 // so we have to check whether binary...
737 case 'IMAGE':
738 case 'LONGBLOB':
739 case 'BLOB':
740 case 'MEDIUMBLOB':
741 case 'BINARY':
742 return !empty($fieldobj->binary) ? 'B' : 'X';
744 case 'YEAR':
745 case 'DATE': return 'D';
747 case 'TIME':
748 case 'DATETIME':
749 case 'TIMESTAMP': return 'T';
751 case 'INT':
752 case 'INTEGER':
753 case 'BIGINT':
754 case 'TINYINT':
755 case 'MEDIUMINT':
756 case 'SMALLINT':
758 if (!empty($fieldobj->primary_key)) return 'R';
759 else return 'I';
761 default: return 'N';
767 class ADORecordSet_ext_mysql extends ADORecordSet_mysql {
768 function ADORecordSet_ext_mysql($queryID,$mode=false)
770 if ($mode === false) {
771 global $ADODB_FETCH_MODE;
772 $mode = $ADODB_FETCH_MODE;
774 switch ($mode)
776 case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
777 case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
778 case ADODB_FETCH_DEFAULT:
779 case ADODB_FETCH_BOTH:
780 default:
781 $this->fetchMode = MYSQL_BOTH; break;
783 $this->adodbFetchMode = $mode;
784 $this->ADORecordSet($queryID);
787 function MoveNext()
789 return @adodb_movenext($this);