Source for file adodb-pdo_mysql.inc.php
Documentation is available at adodb-pdo_mysql.inc.php
V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
function _init($parentDriver)
$parentDriver->hasTransactions = false;
$parentDriver->_bindInputArray = false;
$parentDriver->hasInsertID = true;
$parentDriver->_connectionID->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
// dayFraction is a day in floating point
if (!$date) $date = $this->sysDate;
$fraction = $dayFraction * 24 * 3600;
return $date . ' + INTERVAL ' . $fraction. ' SECOND';
// return "from_unixtime(unix_timestamp($date)+$fraction)";
function &MetaTables($ttype= false,$showSchema= false,$mask= false)
$mask = $this->qstr($mask);
if (empty($transaction_mode)) {
$this->Execute('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ');
if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '. $transaction_mode;
$this->Execute("SET SESSION TRANSACTION ". $transaction_mode);
global $ADODB_FETCH_MODE;
$save = $ADODB_FETCH_MODE;
$ADODB_FETCH_MODE = $save;
$fld->name = $rs->fields[0];
// split type into type(length):
if (preg_match("/^(.+)\((\d+),(\d+)/", $type, $query_array)) {
$fld->type = $query_array[1];
$fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : - 1;
$fld->scale = is_numeric($query_array[3]) ? $query_array[3] : - 1;
} elseif (preg_match("/^(.+)\((\d+)/", $type, $query_array)) {
$fld->type = $query_array[1];
$fld->max_length = is_numeric($query_array[2]) ? $query_array[2] : - 1;
} elseif (preg_match("/^(enum)\((.*)\)$/i", $type, $query_array)) {
$fld->type = $query_array[1];
$arr = explode(",",$query_array[2]);
$fld->max_length = ($zlen > 0) ? $zlen : 1;
$fld->not_null = ($rs->fields[2] != 'YES');
$fld->primary_key = ($rs->fields[3] == 'PRI');
$fld->auto_increment = (strpos($rs->fields[5], 'auto_increment') !== false);
if ($d != '' && $d != 'NULL') {
$fld->has_default = true;
$fld->default_value = $d;
$fld->has_default = false;
// parameters use PostgreSQL convention, not MySQL
function &SelectLimit($sql,$nrows=- 1,$offset=- 1,$inputarr= false,$secs= 0)
$offsetStr = ($offset>= 0) ? "$offset," : '';
// jason judge, see http://phplens.com/lens/lensforum/msgs.php?id=9220
if ($nrows < 0) $nrows = '18446744073709551615';
$rs = & $this->CacheExecute($secs,$sql. " LIMIT $offsetStr$nrows",$inputarr);
$rs = & $this->Execute($sql. " LIMIT $offsetStr$nrows",$inputarr);
|