forked from extern/egroupware
import ADOdb 4.52
This commit is contained in:
parent
ee3f5cafff
commit
9a67dc3141
@ -7,7 +7,7 @@ global $ADODB_INCLUDED_CSV;
|
||||
$ADODB_INCLUDED_CSV = 1;
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
@ -721,4 +721,4 @@ class ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
} // class
|
||||
?>
|
||||
?>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @version V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
* @version V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
* @version V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -62,8 +62,10 @@ function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_
|
||||
|
||||
if ($uSet && $where) {
|
||||
$update = "UPDATE $table SET $uSet WHERE $where";
|
||||
|
||||
$rs = $zthis->Execute($update);
|
||||
|
||||
|
||||
$rs = $zthis->_Execute($update);
|
||||
if ($rs) {
|
||||
if ($zthis->poorAffectedRows) {
|
||||
/*
|
||||
@ -81,8 +83,10 @@ function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_
|
||||
|
||||
if (($zthis->Affected_Rows()>0)) return 1;
|
||||
}
|
||||
}
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
// print "<p>Error=".$this->ErrorNo().'<p>';
|
||||
$first = true;
|
||||
foreach($fieldArray as $k => $v) {
|
||||
@ -98,7 +102,7 @@ function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_
|
||||
}
|
||||
}
|
||||
$insert = "INSERT INTO $table ($iCols) VALUES ($iVals)";
|
||||
$rs = $zthis->_Execute($insert);
|
||||
$rs = $zthis->Execute($insert);
|
||||
return ($rs) ? 2 : 0;
|
||||
}
|
||||
|
||||
@ -218,7 +222,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
|
||||
if (preg_match('/\s*UNION\s*/is', $sql)) $rewritesql = $sql;
|
||||
else $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$sql);
|
||||
|
||||
$rstest = &$zthis->_Execute($rewritesql,$inputarr);
|
||||
$rstest = &$zthis->Execute($rewritesql,$inputarr);
|
||||
if ($rstest) {
|
||||
$qryRecs = $rstest->RecordCount();
|
||||
if ($qryRecs == -1) {
|
||||
@ -355,7 +359,7 @@ function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputar
|
||||
return $rsreturn;
|
||||
}
|
||||
|
||||
function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq=false,$forcenulls=false)
|
||||
function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq=false,$force=2)
|
||||
{
|
||||
if (!$rs) {
|
||||
printf(ADODB_BAD_RS,'GetUpdateSQL');
|
||||
@ -376,8 +380,8 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
|
||||
// If the recordset field is one
|
||||
// of the fields passed in then process.
|
||||
$upperfname = strtoupper($field->name);
|
||||
if (adodb_key_exists($upperfname,$arrFields,$forcenulls)) {
|
||||
|
||||
if (adodb_key_exists($upperfname,$arrFields,$force)) {
|
||||
|
||||
// If the existing field value in the recordset
|
||||
// is different from the value passed in then
|
||||
// go ahead and append the field name and new value to
|
||||
@ -398,20 +402,52 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
|
||||
// Format the value properly for the database
|
||||
$type = $rs->MetaType($field->type);
|
||||
|
||||
// is_null requires php 4.0.4
|
||||
if (($forcenulls && is_null($arrFields[$upperfname])) ||
|
||||
$arrFields[$upperfname] === 'null') {
|
||||
$setFields .= $field->name . " = null, ";
|
||||
} else {
|
||||
if ($type == 'null') {
|
||||
$type = 'C';
|
||||
}
|
||||
|
||||
if (strpos($upperfname,' ') !== false)
|
||||
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;
|
||||
else
|
||||
$fnameq = $upperfname;
|
||||
|
||||
if ($type == 'null') {
|
||||
$type = 'C';
|
||||
}
|
||||
|
||||
if (strpos($upperfname,' ') !== false)
|
||||
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;
|
||||
else
|
||||
$fnameq = $upperfname;
|
||||
|
||||
|
||||
// is_null requires php 4.0.4
|
||||
//********************************************************//
|
||||
if (is_null($arrFields[$upperfname])
|
||||
|| $arrFields[$upperfname] === 'null'
|
||||
|| $arrFields[$upperfname] === ''
|
||||
|| empty($arrFields[$upperfname]))
|
||||
{
|
||||
switch ($force) {
|
||||
|
||||
//case 0:
|
||||
// //Ignore empty values. This is allready handled in "adodb_key_exists" function.
|
||||
//break;
|
||||
|
||||
case 1:
|
||||
//Set null
|
||||
$setFields .= $field->name . " = null, ";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
//Set empty
|
||||
$arrFields[$upperfname] = "";
|
||||
$setFields .= _adodb_column_sql($zthis, 'U', $type, $upperfname, $fnameq,$arrFields, $magicq);
|
||||
break;
|
||||
default:
|
||||
case 3:
|
||||
//Set the value that was given in array, so you can give both null and empty values
|
||||
if (is_null($arrFields[$upperfname]) || $arrFields[$upperfname] === 'null') {
|
||||
$setFields .= $field->name . " = null, ";
|
||||
} else {
|
||||
$setFields .= _adodb_column_sql($zthis, 'U', $type, $upperfname, $fnameq,$arrFields, $magicq);
|
||||
}
|
||||
break;
|
||||
}
|
||||
//********************************************************//
|
||||
} else {
|
||||
//we do this so each driver can customize the sql for
|
||||
//DB specific column types.
|
||||
//Oracle needs BLOB types to be handled with a returning clause
|
||||
@ -454,9 +490,9 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
|
||||
}
|
||||
}
|
||||
|
||||
function adodb_key_exists($key, &$arr,$forcenulls=false)
|
||||
function adodb_key_exists($key, &$arr,$force=2)
|
||||
{
|
||||
if (!$forcenulls) {
|
||||
if ($force<=0) {
|
||||
// the following is the old behaviour where null or empty fields are ignored
|
||||
return (!empty($arr[$key])) || (isset($arr[$key]) && strlen($arr[$key])>0);
|
||||
}
|
||||
@ -474,7 +510,7 @@ function adodb_key_exists($key, &$arr,$forcenulls=false)
|
||||
*
|
||||
*
|
||||
*/
|
||||
function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false,$forcenulls=false)
|
||||
function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false,$force=2)
|
||||
{
|
||||
$tableName = '';
|
||||
$values = '';
|
||||
@ -509,25 +545,49 @@ function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false,$forcenulls=f
|
||||
// Loop through all of the fields in the recordset
|
||||
foreach( $columns as $field ) {
|
||||
$upperfname = strtoupper($field->name);
|
||||
if (adodb_key_exists($upperfname,$arrFields,$forcenulls)) {
|
||||
|
||||
// Set the counter for the number of fields that will be inserted.
|
||||
$fieldInsertedCount++;
|
||||
|
||||
if (adodb_key_exists($upperfname,$arrFields,$force)) {
|
||||
$bad = false;
|
||||
if (strpos($upperfname,' ') !== false)
|
||||
$fnameq = $zthis->nameQuote.$upperfname.$zthis->nameQuote;
|
||||
else
|
||||
$fnameq = $upperfname;
|
||||
|
||||
|
||||
// Get the name of the fields to insert
|
||||
$fields .= $fnameq . ", ";
|
||||
|
||||
$type = $recordSet->MetaType($field->type);
|
||||
|
||||
/********************************************************/
|
||||
if (is_null($arrFields[$upperfname])
|
||||
|| $arrFields[$upperfname] === 'null'
|
||||
|| $arrFields[$upperfname] === ''
|
||||
|| empty($arrFields[$upperfname]))
|
||||
{
|
||||
switch ($force) {
|
||||
|
||||
case 0: // we must always set null if missing
|
||||
$bad = true;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$values .= "null, ";
|
||||
break;
|
||||
|
||||
if (($forcenulls && is_null($arrFields[$upperfname])) ||
|
||||
$arrFields[$upperfname] === 'null') {
|
||||
$values .= "null, ";
|
||||
case 2:
|
||||
//Set empty
|
||||
$arrFields[$upperfname] = "";
|
||||
$values .= _adodb_column_sql($zthis, 'I', $type, $upperfname, $fnameq,$arrFields, $magicq);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 3:
|
||||
//Set the value that was given in array, so you can give both null and empty values
|
||||
if (is_null($arrFields[$upperfname]) || $arrFields[$upperfname] === 'null') {
|
||||
$values .= "null, ";
|
||||
} else {
|
||||
$values .= _adodb_column_sql($zthis, 'I', $type, $upperfname, $fnameq, $arrFields, $magicq);
|
||||
}
|
||||
break;
|
||||
} // switch
|
||||
|
||||
/*********************************************************/
|
||||
} else {
|
||||
//we do this so each driver can customize the sql for
|
||||
//DB specific column types.
|
||||
@ -535,7 +595,15 @@ function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false,$forcenulls=f
|
||||
//postgres has special needs as well
|
||||
$values .= _adodb_column_sql($zthis, 'I', $type, $upperfname, $fnameq,
|
||||
$arrFields, $magicq);
|
||||
}
|
||||
}
|
||||
|
||||
if ($bad) continue;
|
||||
// Set the counter for the number of fields that will be inserted.
|
||||
$fieldInsertedCount++;
|
||||
|
||||
|
||||
// Get the name of the fields to insert
|
||||
$fields .= $fnameq . ", ";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -793,7 +793,7 @@ static $daylight;
|
||||
case 'S':
|
||||
$d10 = $day % 10;
|
||||
if ($d10 == 1) $dates .= 'st';
|
||||
else if ($d10 == 2) $dates .= 'nd';
|
||||
else if ($d10 == 2 && $day != 12) $dates .= 'nd';
|
||||
else if ($d10 == 3) $dates .= 'rd';
|
||||
else $dates .= 'th';
|
||||
break;
|
||||
|
@ -14,7 +14,7 @@
|
||||
/**
|
||||
\mainpage
|
||||
|
||||
@version V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim\@natsoft.com.my). All rights reserved.
|
||||
@version V4.52 10 Aug 2004 (c) 2000-2004 John Lim (jlim\@natsoft.com.my). All rights reserved.
|
||||
|
||||
Released under both BSD license and Lesser GPL library license. You can choose which license
|
||||
you prefer.
|
||||
@ -64,6 +64,24 @@
|
||||
//==============================================================================================
|
||||
|
||||
$ADODB_EXTENSION = defined('ADODB_EXTENSION');
|
||||
|
||||
//********************************************************//
|
||||
/*
|
||||
Controls $ADODB_FORCE_TYPE mode. Default is ADODB_FORCE_VALUE (3).
|
||||
Used in GetUpdateSql and GetInsertSql functions. Thx to Niko, nuko#mbnet.fi
|
||||
|
||||
0 = ignore empty fields. All empty fields in array are ignored.
|
||||
1 = force null. All empty, php null and string 'null' fields are changed to sql NULL values.
|
||||
2 = force empty. All empty, php null and string 'null' fields are changed to sql empty '' or 0 values.
|
||||
3 = force value. Value is left as it is. Php null and string 'null' are set to sql NULL values and empty fields '' are set to empty '' sql values.
|
||||
*/
|
||||
define('ADODB_FORCE_IGNORE',0);
|
||||
define('ADODB_FORCE_NULL',1);
|
||||
define('ADODB_FORCE_EMPTY',2);
|
||||
define('ADODB_FORCE_VALUE',3);
|
||||
//********************************************************//
|
||||
|
||||
|
||||
if (!$ADODB_EXTENSION || ADODB_EXTENSION < 4.0) {
|
||||
|
||||
define('ADODB_BAD_RS','<p>Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true;</p>');
|
||||
@ -132,10 +150,13 @@
|
||||
$ADODB_vers, // database version
|
||||
$ADODB_COUNTRECS, // count number of records returned - slows down query
|
||||
$ADODB_CACHE_DIR, // directory to cache recordsets
|
||||
$ADODB_FETCH_MODE;
|
||||
$ADODB_FETCH_MODE,
|
||||
$ADODB_FORCE_TYPE;
|
||||
|
||||
$ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT;
|
||||
|
||||
$ADODB_FORCE_TYPE = ADODB_FORCE_VALUE;
|
||||
|
||||
|
||||
if (!isset($ADODB_CACHE_DIR)) {
|
||||
$ADODB_CACHE_DIR = '/tmp'; //(isset($_ENV['TMP'])) ? $_ENV['TMP'] : '/tmp';
|
||||
} else {
|
||||
@ -151,7 +172,7 @@
|
||||
/**
|
||||
* ADODB version as a string.
|
||||
*/
|
||||
$ADODB_vers = 'V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
|
||||
$ADODB_vers = 'V4.52 10 Aug 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
|
||||
|
||||
/**
|
||||
* Determines whether recordset->RecordCount() is used.
|
||||
@ -1593,14 +1614,21 @@
|
||||
*
|
||||
* "Jonathan Younger" <jyounger@unilab.com>
|
||||
*/
|
||||
function GetUpdateSQL(&$rs, $arrFields,$forceUpdate=false,$magicq=false,$forcenulls=null)
|
||||
function GetUpdateSQL(&$rs, $arrFields,$forceUpdate=false,$magicq=false,$force=null)
|
||||
{
|
||||
global $ADODB_INCLUDED_LIB;
|
||||
if (!isset($forcenulls)) {
|
||||
$forcenulls = defined('ADODB_FORCE_NULLS') ? true : false;
|
||||
|
||||
//********************************************************//
|
||||
//This is here to maintain compatibility
|
||||
//with older adodb versions. Sets force type to force nulls if $forcenulls is set.
|
||||
if (!isset($force)) {
|
||||
global $ADODB_FORCE_TYPE;
|
||||
$force = $ADODB_FORCE_TYPE;
|
||||
}
|
||||
//********************************************************//
|
||||
|
||||
if (empty($ADODB_INCLUDED_LIB)) include_once(ADODB_DIR.'/adodb-lib.inc.php');
|
||||
return _adodb_getupdatesql($this,$rs,$arrFields,$forceUpdate,$magicq,$forcenulls);
|
||||
return _adodb_getupdatesql($this,$rs,$arrFields,$forceUpdate,$magicq,$force);
|
||||
}
|
||||
|
||||
|
||||
@ -1612,14 +1640,16 @@
|
||||
* Note: This function should only be used on a recordset
|
||||
* that is run against a single table.
|
||||
*/
|
||||
function GetInsertSQL(&$rs, $arrFields,$magicq=false,$forcenulls=null)
|
||||
function GetInsertSQL(&$rs, $arrFields,$magicq=false,$force=null)
|
||||
{
|
||||
global $ADODB_INCLUDED_LIB;
|
||||
if (!isset($forcenulls)) {
|
||||
$forcenulls = defined('ADODB_FORCE_NULLS') ? true : false;
|
||||
if (!isset($force)) {
|
||||
global $ADODB_FORCE_TYPE;
|
||||
$force = $ADODB_FORCE_TYPE;
|
||||
|
||||
}
|
||||
if (empty($ADODB_INCLUDED_LIB)) include_once(ADODB_DIR.'/adodb-lib.inc.php');
|
||||
return _adodb_getinsertsql($this,$rs,$arrFields,$magicq,$forcenulls);
|
||||
return _adodb_getinsertsql($this,$rs,$arrFields,$magicq,$force);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
@ -249,4 +249,4 @@ CREATE TABLE
|
||||
return $ftype;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
@ -177,4 +177,4 @@ class ADODB2_mysql extends ADODB_DataDict {
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
@ -307,4 +307,4 @@ CREATE [ UNIQUE ] INDEX index_name ON table
|
||||
return $sql;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -57,9 +57,12 @@ pre {
|
||||
<a href="#caching">Caching</a><br>
|
||||
<a href="#pivot">Pivot Tables</a></b>
|
||||
<p><a href="#ref"><b>REFERENCE</b></a>
|
||||
<p> <font size="2">Variables: <a href="#adodb_countrecs">$ADODB_COUNTRECS</a> <a href=#adodb_ansi_padding_off>$ADODB_ANSI_PADDING_OFF</a>
|
||||
<a href="#adodb_cache_dir">$ADODB_CACHE_DIR</a> </font><font size="2"><a href=#adodb_fetch_mode>$ADODB_FETCH_MODE</a>
|
||||
<a href=#adodb_lang>$ADODB_LANG</a><br>
|
||||
<p> <font size="2">Variables: <a href="#adodb_countrecs">$ADODB_COUNTRECS</a>
|
||||
<a href=#adodb_ansi_padding_off>$ADODB_ANSI_PADDING_OFF</a>
|
||||
<a href="#adodb_cache_dir">$ADODB_CACHE_DIR</a> <BR>
|
||||
<a href=#force_type>$ADODB_FORCE_TYPE</a>
|
||||
<a href=#adodb_fetch_mode>$ADODB_FETCH_MODE</a>
|
||||
<a href=#adodb_lang>$ADODB_LANG</a> <br>
|
||||
Constants: </font><font size="2"><a href=#adodb_assoc_case>ADODB_ASSOC_CASE</a>
|
||||
</font><br>
|
||||
<a href="#ADOConnection"><b> ADOConnection</b></a><br>
|
||||
@ -586,6 +589,7 @@ catch exceptions on errors as they occur.
|
||||
$db->Connect('','scott','bad-password');
|
||||
} catch (exception $e) {
|
||||
var_dump($e);
|
||||
adodb_backtrace($e->gettrace());
|
||||
}
|
||||
</pre>
|
||||
<p>Note that reaching EOF is <b>not</b> considered an error nor an exception.
|
||||
@ -1227,9 +1231,30 @@ $conn->Execute($updateSQL); # Update the record in the database
|
||||
$conn->Close();
|
||||
?>
|
||||
</pre>
|
||||
GetInsertSQL/GetUpdateSQL ignore all empty fields (they are not added to the SQL generated).
|
||||
To explicitly force a field to be set to "null", set the constant define('ADODB_FORCE_NULLS',1) before
|
||||
you call the functions.
|
||||
<a name=ADODB_FORCE_TYPE></a>
|
||||
<b>$ADODB_FORCE_TYPE</b><p>
|
||||
The behaviour of GetUpdateSQL() and GetInsertSQL()
|
||||
when converting empty or null PHP variables to SQL is controlled by the
|
||||
global $ADODB_FORCE_TYPE variable. Set it to one of the values below. Default
|
||||
is ADODB_FORCE_VALUE (3):
|
||||
<pre>
|
||||
0 = ignore empty fields. All empty fields in array are ignored.
|
||||
1 = force null. All empty, php null and string 'null' fields are changed to sql NULL values.
|
||||
2 = force empty. All empty, php null and string 'null' fields are changed to sql empty '' or 0 values.
|
||||
3 = force value. Value is left as it is. Php null and string 'null' are set to sql NULL values and
|
||||
empty fields '' are set to empty '' sql values.
|
||||
|
||||
define('ADODB_FORCE_IGNORE',0);
|
||||
define('ADODB_FORCE_NULL',1);
|
||||
define('ADODB_FORCE_EMPTY',2);
|
||||
define('ADODB_FORCE_VALUE',3);
|
||||
</pre>
|
||||
<p>
|
||||
Thanks to Niko (nuko#mbnet.fi) for the $ADODB_FORCE_TYPE code.
|
||||
<p>
|
||||
Note: the constant ADODB_FORCE_NULLS is obsolete since 4.52 and is ignored. Set $ADODB_FORCE_TYPE = ADODB_FORCE_NULL
|
||||
for equivalent behaviour.
|
||||
|
||||
<p>
|
||||
<h3>Example 8: Implementing Scrolling with Next and Previous<a name="ex8"></a></h3>
|
||||
<p> The following code creates a very simple recordset pager, where you can scroll
|
||||
@ -1405,9 +1430,19 @@ $conn-><strong>CompleteTrans</strong>();
|
||||
</pre>
|
||||
<p>Note: Savepoints are currently not supported.
|
||||
<h2><a name="errorhandling"></a>Using Custom Error Handlers and PEAR_Error</h2>
|
||||
Apart from the old $con->debug = true; way of debugging, ADOdb 1.50 onwards provides
|
||||
another way of handling errors using ADOdb's custom error handlers.
|
||||
<p> ADOdb provides two custom handlers which you can modify for your needs. The
|
||||
<p>ADOdb supports PHP5 exceptions. Just include <i>adodb-exceptions.inc.php</i> and you can now
|
||||
catch exceptions on errors as they occur.
|
||||
<pre>
|
||||
<b>include("../adodb-exceptions.inc.php");</b>
|
||||
include("../adodb.inc.php");
|
||||
try {
|
||||
$db = NewADOConnection("oci8://scott:bad-password@mytns/");
|
||||
} catch (exception $e) {
|
||||
var_dump($e);
|
||||
adodb_backtrace($e->gettrace());
|
||||
}
|
||||
</pre>
|
||||
<p> ADOdb also provides two custom handlers which you can modify for your needs. The
|
||||
first one is in the <b>adodb-errorhandler.inc.php</b> file. This makes use of
|
||||
the standard PHP functions <a href=http://php.net/error_reporting>error_reporting</a>
|
||||
to control what error messages types to display, and <a href=http://php.net/trigger_error>trigger_error</a>
|
||||
@ -1801,6 +1836,8 @@ in adodb/lang/adodb-$lang.inc.php, where $lang is the supported langauge.
|
||||
<p>To use it, declare it before you incldue adodb.inc.php.</p>
|
||||
<p>define('ADODB_ASSOC_CASE', 2); # use native-case for ADODB_FETCH_ASSOC<br>
|
||||
include('adodb.inc.php'); </p>
|
||||
<h3><font color="#000000"><a name="force_type"></a></font>$ADODB_FORCE_TYPE</h3>
|
||||
<p>See the <a href=#ADODB_FORCE_TYPE>GetUpdateSQL tutorial</a>.
|
||||
<hr>
|
||||
<h2>ADOConnection<a name="adoconnection"></a></h2>
|
||||
<p>Object that performs the connection to the database, executes SQL statements
|
||||
@ -2234,7 +2271,7 @@ $ret = $db->Replace('atable2',
|
||||
array('firstname'=>"'Harun'",'lastname'=>"'Al-Rashid'", 'age' => 'null'),
|
||||
array('lastname','firstname'));
|
||||
</pre>
|
||||
<p><b>GetUpdateSQL<a name="getupdatesql"></a>(&$rs, $arrFields, $forceUpdate=false,$magicq=false, $forcenulls=false)</b></p>
|
||||
<p><b>GetUpdateSQL<a name="getupdatesql"></a>(&$rs, $arrFields, $forceUpdate=false,$magicq=false, $force=null)</b></p>
|
||||
<p>Generate SQL to update a table given a recordset $rs, and the modified fields
|
||||
of the array $arrFields (which must be an associative array holding the column
|
||||
names and the new values) are compared with the current recordset. If $forceUpdate
|
||||
@ -2242,20 +2279,17 @@ $ret = $db->Replace('atable2',
|
||||
$rs->fields. Requires the recordset to be associative. $magicq is used
|
||||
to indicate whether magic quotes are enabled (see qstr()). The field names in the array
|
||||
are case-insensitive.</p>
|
||||
<p>Since 3.61, define('ADODB_FORCE_NULLS',1) and all PHP nulls will be auto-converted to SQL nulls.
|
||||
Since 4.24, we allow you to pass in $forcenulls as a parameter. This overrides the ADODB_FORCE_NULLS
|
||||
constant.
|
||||
<p><b>GetInsertSQL<a name="getinsertsql"></a>(&$rs, $arrFields,$magicq=false,$forcenulls=false)</b></p>
|
||||
<p>Since 4.52, we allow you to pass the $force type parameter, and this overrides the <a href=#ADODB_FORCE_TYPE>$ADODB_FORCE_TYPE</a>
|
||||
global variable.
|
||||
<p><b>GetInsertSQL<a name="getinsertsql"></a>(&$rs, $arrFields,$magicq=false,$force=false)</b></p>
|
||||
<p>Generate SQL to insert into a table given a recordset $rs. Requires the query
|
||||
to be associative. $magicq is used to indicate whether magic quotes are enabled
|
||||
(for qstr()). The field names in the array are case-insensitive.</p>
|
||||
<p>
|
||||
Since 2.42, you can pass a table name instead of a recordset into
|
||||
GetInsertSQL (in $rs), and it will generate an insert statement for that table.
|
||||
<p>Since 3.61, define('ADODB_FORCE_NULLS',1) and all PHP nulls will be auto-converted
|
||||
to SQL nulls.
|
||||
Since 4.24, we allow you to pass in $forcenulls as a parameter. This overrides the ADODB_FORCE_NULLS
|
||||
constant.
|
||||
<p>Since 4.52, we allow you to pass the $force type parameter, and this overrides the <a href=#ADODB_FORCE_TYPE>$ADODB_FORCE_TYPE</a>
|
||||
global variable.
|
||||
<p><b>PageExecute<a name="pageexecute"></a>($sql, $nrows, $page, $inputarr=false)</b>
|
||||
<p>Used for pagination of recordset. $page is 1-based. See <a href="#ex8">Example
|
||||
8</a>.</p>
|
||||
@ -3278,6 +3312,11 @@ $<font color="#663300">rs</font> = $<font color="#663300">conn</font>->Execute
|
||||
PHP</a>. </p>
|
||||
</font>
|
||||
<h2>Change Log<a name="Changes"></a><a name="changes"></a><a name="changelog"></a></h2>
|
||||
<p><a name=4.52></a><b>4.52 ?? 2004</b>
|
||||
<p>Bug found in Replace() when performance logging enabled, introduced in ADOdb 4.50. Fixed.
|
||||
<p>Replace() checks update stmt. If update stmt fails, we now return immediately. Thx to alex.
|
||||
<p>Added support for $ADODB_FORCE_TYPE in GetUpdateSQL/GetInsertSQL. Thx to niko.
|
||||
<p>Added ADODB_ASSOC_CASE support to postgres/postgres7 driver.
|
||||
<p><a name=4.51></a><b>4.51 29 July 2004</b>
|
||||
<p>Added adodb-xmlschema 1.0.2. Thx dan and richard.
|
||||
<p>Added new adorecordset_ext_* classes. If ADOdb extension installed for mysql, mysqlt and oci8
|
||||
|
@ -96,7 +96,7 @@ including adodb-cryptsession.inc.php instead of adodb-session.inc.php. </li>
|
||||
<pre>
|
||||
<font color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b> $ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br> $ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br> $ADODB_SESSION_DB ='sessiondb';</b><br> <br> <b>include('adodb/session/adodb-session.php');<br> adodb_sess_open(false,false,false);</b><br> session_start();<br> </font>
|
||||
</pre>
|
||||
<p> To use a encrypted sessions, simply replace the file:</p>
|
||||
<p> To use a encrypted sessions, simply replace the file adodb-session.php:</p>
|
||||
<pre> <font
|
||||
color="#004040"><br> include('adodb/adodb.inc.php');<br> <br><b> $ADODB_SESSION_DRIVER='mysql';<br> $ADODB_SESSION_CONNECT='localhost';<br> $ADODB_SESSION_USER ='scott';<br> $ADODB_SESSION_PWD ='tiger';<br> $ADODB_SESSION_DB ='sessiondb';<br> <br> include('adodb/session/adodb-cryptsession.php');</b><br> session_start();</font><br>
|
||||
</pre>
|
||||
@ -110,7 +110,7 @@ including adodb-cryptsession.inc.php instead of adodb-session.inc.php. </li>
|
||||
name="sessiontab"></a> <font color="#004040"><br> create table sessions (<br> SESSKEY char(32) not null,<br> EXPIRY int(11) unsigned not null,<br> EXPIREREF varchar(64),<br> DATA text not null,<br> primary key (sesskey)<br> );</font><br>
|
||||
</pre>
|
||||
<p> For the adodb-session-clob.php version, create this:
|
||||
<pre>
|
||||
<p> <pre>
|
||||
<font
|
||||
color="#004040"><br> create table sessions (<br> SESSKEY char(32) not null,<br> EXPIRY int(11) unsigned not null,<br> EXPIREREF varchar(64),<br> DATA CLOB,<br> primary key (sesskey)<br> );</font>
|
||||
</pre>
|
||||
@ -118,7 +118,7 @@ including adodb-cryptsession.inc.php instead of adodb-session.inc.php. </li>
|
||||
<pre> <font
|
||||
color="#004040"><br> $ADODB_SESSION_DRIVER='database driver, eg. mysql or ibase';<br> $ADODB_SESSION_CONNECT='server to connect to';<br> $ADODB_SESSION_USER ='user';<br> $ADODB_SESSION_PWD ='password';<br> $ADODB_SESSION_DB ='database';<br> $ADODB_SESSION_TBL = 'sessions'; # setting this is optional<br> </font>
|
||||
</pre><p>
|
||||
When the session is created, $<b>ADODB_SESS_CONN</b> holds the connection object.<br> <br> 3. Recommended is PHP 4.0.6 or later. There are documented session bugs <br> in earlier versions of PHP.
|
||||
When the session is created, $<b>ADODB_SESS_CONN</b> holds the connection object.<br> <br> 3. Recommended is PHP 4.0.6 or later. There are documented session bugs in earlier versions of PHP.
|
||||
<h3>Notifications</h3>
|
||||
<p>If you want to receive notification when a session expires, then tag
|
||||
the session record with a <a href="#sessiontab">EXPIREREF</a> tag (see
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<h3>ADOdb Library for PHP</h3>
|
||||
<p>ADOdb is a suite of database libraries that allow you to connect to multiple
|
||||
databases in a portable manner. Download from <a href=http://php.weblogs.com/adodb>http://php.weblogs.com/adodb</a>.
|
||||
databases in a portable manner. Download from <a href=http://adodb.sourceforge.net/>http://adodb.sourceforge.net/</a>.
|
||||
<ul><li>The ADOdb documentation has moved to <a href=docs-adodb.htm>docs-adodb.htm</a>
|
||||
This allows you to query, update and insert records using a portable API.
|
||||
<p><li>The ADOdb data dictionary docs are at <a href=docs-datadict.htm>docs-datadict.htm</a>.
|
||||
@ -40,8 +40,7 @@ print "</pre>";
|
||||
?>
|
||||
</pre>
|
||||
<h3>How are people using ADOdb</h3>
|
||||
Here are some examples of how people are using ADOdb (for a much longer list,
|
||||
visit <a href="http://php.weblogs.com/adodb-cool-applications">http://php.weblogs.com/adodb-cool-applications</a>):
|
||||
Here are some examples of how people are using ADOdb:
|
||||
<ul>
|
||||
<li> <strong>PhpLens</strong> is a commercial data grid component that allows
|
||||
both cool Web designers and serious unshaved programmers to develop and
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim. All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 John Lim. 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
|
||||
First cut at the Netezza Driver by Josh Eldridge joshuae74#hotmail.com
|
||||
Based on the previous postgres drivers.
|
||||
|
@ -575,7 +575,7 @@ NATSOFT.DOMAIN =
|
||||
if ($this->session_sharing_force_blob) $this->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT');
|
||||
$commit = $this->autoCommit;
|
||||
if ($commit) $this->BeginTrans();
|
||||
$rs = $this->_Execute($sql,$arr);
|
||||
$rs = $this->Execute($sql,$arr);
|
||||
if ($rez = !empty($rs)) $desc->save($val);
|
||||
$desc->free();
|
||||
if ($commit) $this->CommitTrans();
|
||||
@ -630,7 +630,8 @@ NATSOFT.DOMAIN =
|
||||
|
||||
$BINDNUM += 1;
|
||||
|
||||
if (@OCIStatementType($stmt) == 'BEGIN') {
|
||||
$sttype = @OCIStatementType($stmt);
|
||||
if ($sttype == 'BEGIN' || $sttype == 'DECLARE') {
|
||||
return array($sql,$stmt,0,$BINDNUM, ($cursor) ? OCINewCursor($this->_connectionID) : false);
|
||||
}
|
||||
|
||||
@ -869,7 +870,8 @@ NATSOFT.DOMAIN =
|
||||
switch (@OCIStatementType($stmt)) {
|
||||
case "SELECT":
|
||||
return $stmt;
|
||||
|
||||
|
||||
case 'DECLARE':
|
||||
case "BEGIN":
|
||||
if (is_array($sql) && !empty($sql[4])) {
|
||||
$cursor = $sql[4];
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim. All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 John Lim. 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
@ -25,6 +25,9 @@ class ADODB_postgres7 extends ADODB_postgres64 {
|
||||
function ADODB_postgres7()
|
||||
{
|
||||
$this->ADODB_postgres64();
|
||||
if (ADODB_ASSOC_CASE !== 2) {
|
||||
$this->rsPrefix .= 'assoc_';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -189,4 +192,74 @@ class ADORecordSet_postgres7 extends ADORecordSet_postgres64{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ADORecordSet_assoc_postgres7 extends ADORecordSet_postgres64{
|
||||
|
||||
var $databaseType = "postgres7";
|
||||
|
||||
|
||||
function ADORecordSet_assoc_postgres7($queryID,$mode=false)
|
||||
{
|
||||
$this->ADORecordSet_postgres64($queryID,$mode);
|
||||
}
|
||||
|
||||
function _fetch()
|
||||
{
|
||||
if ($this->_currentRow >= $this->_numOfRows && $this->_numOfRows >= 0)
|
||||
return false;
|
||||
|
||||
$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
|
||||
|
||||
if ($this->fields) {
|
||||
if (isset($this->_blobArr)) $this->_fixblobs();
|
||||
$this->_updatefields();
|
||||
}
|
||||
|
||||
return (is_array($this->fields));
|
||||
}
|
||||
|
||||
// Create associative array
|
||||
function _updatefields()
|
||||
{
|
||||
if (ADODB_ASSOC_CASE == 2) return; // native
|
||||
|
||||
$arr = array();
|
||||
$lowercase = (ADODB_ASSOC_CASE == 0);
|
||||
|
||||
foreach($this->fields as $k => $v) {
|
||||
if (is_integer($k)) $arr[$k] = $v;
|
||||
else {
|
||||
if ($lowercase)
|
||||
$arr[strtolower($k)] = $v;
|
||||
else
|
||||
$arr[strtoupper($k)] = $v;
|
||||
}
|
||||
}
|
||||
$this->fields = $arr;
|
||||
}
|
||||
|
||||
function MoveNext()
|
||||
{
|
||||
if (!$this->EOF) {
|
||||
$this->_currentRow++;
|
||||
if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
|
||||
$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
|
||||
|
||||
if (is_array($this->fields)) {
|
||||
if ($this->fields) {
|
||||
if (isset($this->_blobArr)) $this->_fixblobs();
|
||||
|
||||
$this->_updatefields();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->fields = false;
|
||||
$this->EOF = true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
@ -170,4 +170,4 @@ class ADORecordSet_sapdb extends ADORecordSet_odbc {
|
||||
}
|
||||
|
||||
} //define
|
||||
?>
|
||||
?>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim. All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 John Lim. 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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. See License.txt.
|
||||
|
@ -1,6 +1,6 @@
|
||||
>> ADODB Library for PHP4
|
||||
|
||||
(c) 2000-2002 John Lim (jlim@natsoft.com.my)
|
||||
(c) 2000-2004 John Lim (jlim@natsoft.com.my)
|
||||
|
||||
Released under both BSD and GNU Lesser GPL library license.
|
||||
This means you can use it in proprietary products.
|
||||
@ -50,6 +50,8 @@ tute.htm is the tutorial.
|
||||
>> More Info
|
||||
|
||||
For more information, including installation see readme.htm
|
||||
or visit
|
||||
http://adodb.sourceforge.net/
|
||||
|
||||
|
||||
>> Feature Requests and Bug Reports
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -8,7 +8,7 @@
|
||||
<body>
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -8,7 +8,7 @@
|
||||
<body>
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -17,11 +17,13 @@ error_reporting(E_ALL);
|
||||
function testsql()
|
||||
{
|
||||
|
||||
//define('ADODB_FORCE_NULLS',1);
|
||||
|
||||
include('../adodb.inc.php');
|
||||
include('../tohtml.inc.php');
|
||||
|
||||
global $ADODB_FORCE_TYPE;
|
||||
|
||||
|
||||
//==========================
|
||||
// This code tests an insert
|
||||
|
||||
@ -47,6 +49,9 @@ $record = array(); // Initialize an array to hold the record data to insert
|
||||
$record["firstname"] = 'null';
|
||||
$record["lastname"] = "Smith\$@//";
|
||||
$record["created"] = time();
|
||||
|
||||
if (isset($_GET['f'])) $ADODB_FORCE_TYPE = $_GET['f'];
|
||||
|
||||
//$record["id"] = -1;
|
||||
|
||||
// Pass the empty recordset and the array containing the data to insert
|
||||
@ -71,20 +76,29 @@ if (!$rs) print "<p><b>No record found!</b></p>";
|
||||
|
||||
$record = array(); // Initialize an array to hold the record data to update
|
||||
|
||||
|
||||
// Set the values for the fields in the record
|
||||
$record["firstName"] = "Caroline".rand();
|
||||
$record["lasTname"] = "Smithy Jones"; // Update Caroline's lastname from Miranda to Smith
|
||||
$record["lasTname"] = ""; // Update Caroline's lastname from Miranda to Smith
|
||||
$record["creAted"] = '2002-12-'.(rand()%30+1);
|
||||
$record['num'] = 3921;
|
||||
$record['num'] = '';
|
||||
// Pass the single record recordset and the array containing the data to update
|
||||
// into the GetUpdateSQL function. The function will process the data and return
|
||||
// a fully formatted update sql statement.
|
||||
// If the data has not changed, no recordset is returned
|
||||
|
||||
$updateSQL = $conn->GetUpdateSQL($rs, $record);
|
||||
|
||||
$conn->Execute($updateSQL); // Update the record in the database
|
||||
if ($conn->Affected_Rows() != 1)print "<p><b>Error</b>: Rows Affected=".$conn->Affected_Rows().", should be 1</p>";
|
||||
|
||||
$record["firstName"] = "Caroline".rand();
|
||||
$record["lasTname"] = "Smithy Jones"; // Update Caroline's lastname from Miranda to Smith
|
||||
$record["creAted"] = '2002-12-'.(rand()%30+1);
|
||||
$record['num'] = 331;
|
||||
$updateSQL = $conn->GetUpdateSQL($rs, $record);
|
||||
$conn->Execute($updateSQL); // Update the record in the database
|
||||
|
||||
$rs = $conn->Execute("select * from adoxyz where lastname like 'Smith%'");
|
||||
adodb_pr($rs);
|
||||
rs2html($rs);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -2,7 +2,7 @@
|
||||
<body>
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -2,7 +2,7 @@
|
||||
<body>
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
|
||||
V4.52 10 Aug 2004 (c) 2000-2004 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.
|
||||
|
Loading…
Reference in New Issue
Block a user