[pLog-svn] r1788 - in plog/branches/plog-1.0.1: class/database/adodb class/database/adodb/datadict class/database/adodb/docs class/database/adodb/drivers class/database/adodb/lang class/database/adodb/pear class/database/adodb/pear/Auth class/database/adodb/pear/Auth/Container class/database/adodb/perf class/database/adodb/session class/database/adodb/tests class/database/adodb/xsl config

oscar at devel.plogworld.net oscar at devel.plogworld.net
Fri Apr 8 19:43:47 GMT 2005


Author: oscar
Date: 2005-04-08 19:43:46 +0000 (Fri, 08 Apr 2005)
New Revision: 1788

Added:
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres8.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php.bak
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase_ase.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-da.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-esperanto.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-uk1251.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/pear/
   plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/
   plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container/
   plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container/ADOdb.php
   plog/branches/plog-1.0.1/class/database/adodb/pear/readme.Auth.txt
   plog/branches/plog-1.0.1/class/database/adodb/server.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/
   plog/branches/plog-1.0.1/class/database/adodb/tests/benchmark.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/client.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/pdo.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test-datadict.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test-perf.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test-pgblob.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test-php5.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test-xmlschema.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test2.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test3.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test4.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test5.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/test_rs_array.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testcache.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testdatabases.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testgenid.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testmssql.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8cursor.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testpaging.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testpear.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/testsessions.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/time.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/tmssql.php
   plog/branches/plog-1.0.1/class/database/adodb/tests/xmlschema.xml
   plog/branches/plog-1.0.1/class/database/adodb/xsl/
   plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.1-0.2.xsl
   plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.2-0.1.xsl
   plog/branches/plog-1.0.1/class/database/adodb/xsl/remove-0.2.xsl
Modified:
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-access.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-db2.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-firebird.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-generic.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-ibase.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-informix.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mssql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mysql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-oci8.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-postgres.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sapdb.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sybase.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/docs/docs-adodb.htm
   plog/branches/plog-1.0.1/class/database/adodb/docs/docs-datadict.htm
   plog/branches/plog-1.0.1/class/database/adodb/docs/docs-oracle.htm
   plog/branches/plog-1.0.1/class/database/adodb/docs/docs-perf.htm
   plog/branches/plog-1.0.1/class/database/adodb/docs/docs-session.htm
   plog/branches/plog-1.0.1/class/database/adodb/docs/old-changelog.htm
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-access.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado5.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_access.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_mssql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-borland_ibase.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-csv.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-db2.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-fbsql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-firebird.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ibase.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix72.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ldap.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssqlpo.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqli.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqlt.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-netezza.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci805.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8po.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_mssql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_oracle.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oracle.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-pdo.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres64.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres7.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-proxy.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sapdb.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlanywhere.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlitepo.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-vfp.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-es.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/perf/perf-db2.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/perf/perf-informix.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mssql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mysql.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/perf/perf-oci8.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/perf/perf-postgres.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/pivottable.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/rsfilter.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-bzip2.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-gzip.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-cryptsession.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-mcrypt.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-md5.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-secret.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session-clob.php
   plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session.php
   plog/branches/plog-1.0.1/class/database/adodb/toexport.inc.php
   plog/branches/plog-1.0.1/class/database/adodb/tohtml.inc.php
   plog/branches/plog-1.0.1/config/config.properties.php
Log:
updated adodb to the latest version, hopefully it will help in this case: http://forums.plogworld.net/viewtopic.php?p=10489#10489

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-access.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-access.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-access.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-db2.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-db2.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-db2.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-firebird.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-firebird.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-firebird.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -21,7 +21,7 @@
 	{
 		switch($meta) {
 		case 'C': return 'VARCHAR';
-		case 'XL':
+		case 'XL': return 'VARCHAR(32000)'; 
 		case 'X': return 'VARCHAR(4000)'; 
 		
 		case 'C2': return 'VARCHAR'; // up to 32K

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-generic.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-generic.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-generic.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-ibase.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-ibase.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-ibase.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-informix.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-informix.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-informix.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mssql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mssql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mssql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -30,7 +30,7 @@
 		
 		$len = -1; // mysql max_length is not accurate
 		switch (strtoupper($t)) {
-
+		case 'R':
 		case 'INT': 
 		case 'INTEGER': return  'I';
 		case 'BIT':
@@ -47,10 +47,10 @@
 	function ActualType($meta)
 	{
 		switch(strtoupper($meta)) {
+
 		case 'C': return 'VARCHAR';
-		case 'XL':
-		case 'X': return 'TEXT';
-		
+		case 'XL': return 'TEXT';
+		case 'X': return 'VARCHAR(4000)'; ## could be varchar(8000), but we want compat with oracle
 		case 'C2': return 'NVARCHAR';
 		case 'X2': return 'NTEXT';
 		
@@ -60,6 +60,7 @@
 		case 'T': return 'DATETIME';
 		case 'L': return 'BIT';
 		
+		case 'R':		
 		case 'I': return 'INT'; 
 		case 'I1': return 'TINYINT';
 		case 'I2': return 'SMALLINT';
@@ -241,12 +242,9 @@
 		case 'BIGINT':
 			return $ftype;
 		}
-		if (strlen($fsize) && $ty != 'X' && $ty != 'B' && strpos($ftype,'(') === false) {
-			$ftype .= "(".$fsize;
-			if (strlen($fprec)) $ftype .= ",".$fprec;
-			$ftype .= ')';
-		}
-		return $ftype;
+    	if ($ty == 'T') return $ftype;
+    	return parent::_GetSize($ftype, $ty, $fsize, $fprec);    
+
 	}
 }
 ?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mysql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mysql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-mysql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -80,8 +80,8 @@
 	{
 		switch(strtoupper($meta)) {
 		case 'C': return 'VARCHAR';
-		case 'XL':
-		case 'X': return 'LONGTEXT';
+		case 'XL':return 'LONGTEXT';
+		case 'X': return 'TEXT';
 		
 		case 'C2': return 'VARCHAR';
 		case 'X2': return 'LONGTEXT';

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-oci8.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-oci8.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-oci8.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-postgres.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-postgres.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-postgres.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sapdb.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sapdb.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sapdb.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.50 6 July 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.50 6 July 2004  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sybase.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sybase.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/datadict/datadict-sybase.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /**
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/docs/docs-adodb.htm
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/docs/docs-adodb.htm	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/docs/docs-adodb.htm	2005-04-08 19:43:46 UTC (rev 1788)
@@ -12,16 +12,14 @@
   border: 1px solid #ddd;
 }
 </style></head>
-<body bgcolor="#ffffff">
+<body bgcolor="#ffffff" text="black">
 
 <h2>ADOdb Library for PHP</h2>
-<p>V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim#natsoft.com)</p>
+<p>V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim#natsoft.com)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and LGPL. This 
   means you can use it in compiled proprietary and commercial products.</font></p>
   
-  
-  <table border="1"><tbody><tr><td><font color="red">Kindly note that the ADOdb home page has moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a> because of the persistent 
-  unreliability of http://php.weblogs.com. <b>Please change your links</b>!</font></td></tr></tbody></table>
+
 	<p>Useful ADOdb links:  <a href="http://adodb.sourceforge.net/#download">Download</a> &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 
 </p><p><a href="#intro"><b>Introduction</b></a><b><br>
@@ -68,9 +66,9 @@
   <font size="2">Connections: <a href="#connect">Connect</a> <a href="#pconnect">PConnect</a> 
   <a href="#nconnect">NConnect</a> <a href="#isconnected">IsConnected</a><br>
   Executing SQL: <a href="#execute">Execute</a> <a href="#cacheexecute"><i>CacheExecute</i></a> 
-  <a href="#SelectLimit">SelectLimit</a> <a href="#cacheSelectLimit"><i>CacheSelectLimit</i></a> 
+  <a href="#selectlimit">SelectLimit</a> <a href="#cacheSelectLimit"><i>CacheSelectLimit</i></a> 
   <a href="#param">Param</a> <a href="#prepare">Prepare</a> <a href="#preparesp">PrepareSP</a> 
-  <a href="#inparameter">InParameter</a> <a href="#outparameter">OutParameter</a>
+  <a href="#inparameter">InParameter</a> <a href="#outparameter">OutParameter</a> <a href="#autoexecute">AutoExecute</a>
   <br>
   &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#getone">GetOne</a> 
   <a href="#cachegetone"><i>CacheGetOne</i></a> <a href="#getrow">GetRow</a> <a href="#cachegetrow"><i>CacheGetRow</i></a> 
@@ -81,9 +79,8 @@
   (oci8 only)<br>
   Generates SQL strings: <a href="#getupdatesql">GetUpdateSQL</a> <a href="#getinsertsql">GetInsertSQL</a> 
   <a href="#concat">Concat</a> <a href="#ifnull">IfNull</a> <a href="#length">length</a> <a href="#random">random</a> <a href="#substr">substr</a> 
-  <a href="#qstr">qstr</a> <a href="#param">Param</a> 
-  <a href="#prepare"></a><a href="#OffsetDate">OffsetDate</a> <a href="#SQLDate">SQLDate</a> 
-  <a href="#dbdate">DBDate</a> <a href="#dbtimestamp"></a> <a href="#dbtimestamp">DBTimeStamp</a>
+  <a href="#qstr">qstr</a> <a href="#param">Param</a>  <a href="#OffsetDate">OffsetDate</a> <a href="#SQLDate">SQLDate</a> 
+  <a href="#dbdate">DBDate</a>  <a href="#dbtimestamp">DBTimeStamp</a>
   <br>
   Blobs: <a href="#updateblob">UpdateBlob</a> <a href="#updateclob">UpdateClob</a> 
   <a href="#updateblobfile">UpdateBlobFile</a> <a href="#blobencode">BlobEncode</a> 
@@ -133,8 +130,9 @@
   <a href="#nextrecordset">NextRecordSet</a><br>
   Field Info:<a href="#fieldcount">FieldCount</a> <a href="#fetchfield">FetchField</a> 
   <a href="#metatype">MetaType</a><br>
-  Cleanup: <a href="#rsclose">Close</a></font> <font size="2"></font> 
-</p><p><font size="2"><a href="#rs2html"><b>rs2html</b></a>&nbsp; <a href="#exrs2html">example</a></font><br>
+  Cleanup: <a href="#rsclose">Close</a></font>  
+</p>
+<p><font size="2"><a href="#rs2html"><b>rs2html</b></a>&nbsp; <a href="#exrs2html">example</a></font><br>
   <a href="#adodiff">Differences between ADOdb and ADO</a><br>
   <a href="#driverguide"><b>Database Driver Guide<br>
   </b></a><b><a href="#changes">Change Log</a></b><br>
@@ -281,9 +279,7 @@
 	'persist', 'persistent', 'debug', 'fetchmode'
 	</td></tr><tr><td>Interbase/Firebird
 	</td><td>
-					 'dialect',
-					 'charset',
-					'buffers'
+					 'dialect','charset','buffers','role'
 	</td></tr><tr><td>M'soft ADO</td><td>
 					 'charpage'
 					
@@ -322,18 +318,68 @@
 <p><a name="connect_ex"> For most drivers, you can use the standard function: Connect($server, $user, $password, $database), or
 a </a><a href="dsnsupport">DSN</a> since ADOdb 4.51. Exceptions to this are listed below.
 </p><h4>PostgreSQL</h4>
-<p>PostgreSQL accepts connections using: </p>
+<p>PostgreSQL 7 and 8 accepts connections using: </p>
 <p>a. the standard connection string:</p>
-<pre>	$conn = &amp;ADONewConnection('postgres7'); <br>	$conn-&gt;PConnect('host=localhost port=5432 dbname=mary');</pre>
+<pre>	$conn = &amp;ADONewConnection('postgres');  <br>	$conn-&gt;PConnect('host=localhost port=5432 dbname=mary');</pre>
 <p> b. the classical 4 parameters:</p>
  <pre>	$conn-&gt;PConnect('localhost','userid','password','database');<br> </pre>
 <p>c. dsn:
-</p><pre>	$dsn = 'postgres7://user:pwd@localhost/mydb?persist';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
+</p><pre>	$dsn = 'postgres://user:pwd@localhost/mydb?persist';  # persist is optional
+	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
 <a name="ldap"></a>
 
  <h4>LDAP</h4>
   <p>Here is an example of querying a LDAP server. Thanks to Josh Eldridge for the driver and this example:
-</p><pre> &lt;?php<br>require('/path/to/adodb.inc.php');<br><br>$host = 'ldap.baylor.edu';<br>$ldapbase = 'ou=People,o=Baylor University,c=US';<br><br>$ldap = NewADOConnection( 'ldap' );<br>$ldap-&gt;Connect( $host, $user_name='', $password='', $ldapbase );<br><br>echo "&lt;pre&gt;";<br><br>print_r( $ldap-&gt;ServerInfo() );<br>$ldap-&gt;SetFetchMode(ADODB_FETCH_ASSOC);<br>$userName = 'eldridge';<br>$filter="(|(CN=$userName*)(sn=$userName*)(givenname=$userName*)(uid=$userName*))";<br><br>$rs = $ldap-&gt;Execute( $filter );<br>if ($rs)<br>	while ($arr = $rs-&gt;FetchRow()) {<br>	     print_r($arr);	<br>	}<br><br>$rs = $ldap-&gt;Execute( $filter );<br>if ($rs) <br>	while (!$rs-&gt;EOF) {<br> 		print_r($rs-&gt;fields);	<br>		$rs-&gt;MoveNext();<br>	} <br>	<br>print_r( $ldap-&gt;GetArray( $filter ) );<br><br>print_r( $ldap-&gt;GetRow( $filter ) );<br><br>$ldap-&gt;Close();<br>echo "&lt;/pre&gt;";<br>?&gt;</pre>
+</p><pre>
+require('/path/to/adodb.inc.php');
+
+/* Make sure to set this BEFORE calling Connect() */
+$LDAP_CONNECT_OPTIONS = Array(
+	Array ("OPTION_NAME"=>LDAP_OPT_DEREF, "OPTION_VALUE"=>2),
+	Array ("OPTION_NAME"=>LDAP_OPT_SIZELIMIT,"OPTION_VALUE"=>100),
+	Array ("OPTION_NAME"=>LDAP_OPT_TIMELIMIT,"OPTION_VALUE"=>30),
+	Array ("OPTION_NAME"=>LDAP_OPT_PROTOCOL_VERSION,"OPTION_VALUE"=>3),
+	Array ("OPTION_NAME"=>LDAP_OPT_ERROR_NUMBER,"OPTION_VALUE"=>13),
+	Array ("OPTION_NAME"=>LDAP_OPT_REFERRALS,"OPTION_VALUE"=>FALSE),
+	Array ("OPTION_NAME"=>LDAP_OPT_RESTART,"OPTION_VALUE"=>FALSE)
+);
+$host = 'ldap.baylor.edu';
+$ldapbase = 'ou=People,o=Baylor University,c=US';
+
+$ldap = NewADOConnection( 'ldap' );
+$ldap->Connect( $host, $user_name='', $password='', $ldapbase );
+
+echo "&lt;pre>";
+
+print_r( $ldap->ServerInfo() );
+$ldap->SetFetchMode(ADODB_FETCH_ASSOC);
+$userName = 'eldridge';
+$filter="(|(CN=$userName*)(sn=$userName*)(givenname=$userName*)(uid=$userName*))";
+
+$rs = $ldap->Execute( $filter );
+if ($rs)
+	while ($arr = $rs->FetchRow()) {
+	     print_r($arr);	
+	}
+
+$rs = $ldap->Execute( $filter );
+if ($rs) 
+	while (!$rs->EOF) {
+ 		print_r($rs->fields);	
+		$rs->MoveNext();
+	} 
+	
+print_r( $ldap->GetArray( $filter ) );
+print_r( $ldap->GetRow( $filter ) );
+
+$ldap->Close();
+echo "&lt;/pre>";
+</pre>
+<p>Using DSN:
+<pre>
+$dsn = "ldap://ldap.baylor.edu/ou=People,o=Baylor University,c=US";
+$db = NewADOConnection($dsn);
+</pre>
 <h4>Interbase/Firebird</h4>
 You define the database in the $host parameter:
 <pre>	$conn = &amp;ADONewConnection('ibase'); <br>	$conn-&gt;PConnect('localhost:c:\ibase\employee.gdb','sysdba','masterkey');<br></pre>
@@ -341,9 +387,12 @@
 </p><pre>	$dsn = 'firebird://user:pwd@localhost/mydb?persist&amp;dialect=3';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
 <h4>SQLite</h4>
 Sqlite will create the database file if it does not exist.
-<pre>	$conn = &amp;ADONewConnection('sqlite'); <br>	$conn-&gt;PConnect('c:\path\to\sqlite.db'); # sqlite will create if does not exist<br></pre>
+<pre>	$conn = &amp;ADONewConnection('sqlite');
+	$conn-&gt;PConnect('c:\path\to\sqlite.db'); # sqlite will create if does not exist<br></pre>
 <p>Or dsn:
-</p><pre>	$dsn = 'sqlite://user:pwd@localhost/mydb?persist';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
+</p><pre>	$path = urlencode('c:\path\to\sqlite.db');
+	$dsn = "sqlite://$path/?persist";  # persist is optional
+	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br></pre>
 <h4>Oracle (oci8)</h4>
 <p>With oci8, you can connect in multiple ways. Note that oci8 works fine with 
 newer versions of the Oracle, eg. 9i and 10g.</p>
@@ -362,14 +411,7 @@
 <p>f. ADOdb dsn:
 </p><pre>	$dsn = 'oci8://user:pwd@tnsname/?persist';  # persist is optional<br>	$conn = ADONewConnection($dsn);  # no need for Connect/PConnect<br>	<br>	$dsn = 'oci8://user:pwd@host/sid';<br>	$conn = ADONewConnection($dsn);<br>	<br>	$dsn = 'oci8://user:pwd@/';   # oracle on local machine<br>	$conn = ADONewConnection($dsn);<br></pre>
 <p>You can also set the charSet for Oracle 9.2 and later, supported since PHP 4.3.2, ADOdb 4.54:
-<pre>
-	$conn->charSet = 'we8iso8859p1';
-	$conn->Connect(...);
-	
-	# or
-	$dsn = 'oci8://user:pwd@tnsname/?charset=WE8MSWIN1252';
-	$db = ADONewConnection($dsn);
-</pre>
+</p><pre>	$conn-&gt;charSet = 'we8iso8859p1';<br>	$conn-&gt;Connect(...);<br>	<br>	# or<br>	$dsn = 'oci8://user:pwd@tnsname/?charset=WE8MSWIN1252';<br>	$db = ADONewConnection($dsn);<br></pre>
 <a name="dsnless"></a>
 <h4>DSN-less ODBC ( Access, MSSQL and DB2 examples)</h4>
 <p>ODBC DSN's can be created in the ODBC control panel, or you can use a DSN-less 
@@ -382,7 +424,7 @@
 For Microsoft SQL Server: 
 <pre>	$db =&amp; ADONewConnection('odbc_mssql');<br>	$dsn = <strong>"Driver={SQL Server};Server=localhost;Database=northwind;"</strong>;<br>	$db-&gt;Connect($dsn,'userid','password');<br></pre>
 or if you prefer to use the mssql extension (which is limited to mssql 6.5 functionality):
-<pre>	$db =&amp; ADONewConnection('mssql');<br>	$db-&gt;Execute("localhost', 'userid', 'password', 'northwind');<br></pre>
+<pre>	$db =&amp; ADONewConnection('mssql');<br>	$db-&gt;Execute('localhost', 'userid', 'password', 'northwind');<br></pre>
 For DB2:
 <pre>	$db =&amp; ADONewConnection('db2');<br>	$dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP;".<br>			"uid=root; pwd=secret";<br>	$db-&gt;Connect($dsn);<br></pre>
 <b>DSN-less Connections with ADO</b><br>
@@ -481,7 +523,7 @@
 <h3><a name="drivers"></a>Databases Supported</h3>
 The <i>name</i> below is the value you pass to NewADOConnection($name) to create a  connection object for that database.
 <p>
-<p> 
+</p><p> 
 </p><table border="1" width="100%">
   <tbody><tr valign="top"> 
     <td><b>Name</b></td>
@@ -562,7 +604,7 @@
       $db-&gt;PConnect('localhost:c:/ibase/employee.gdb', "sysdba", "masterkey") 
       to connect. Lacks Affected_Rows currently.<br>
       <br>
-      You can set $db-&gt;dialect, $db-&gt;buffers and $db-&gt;charSet before connecting.</font></td>
+      You can set $db-&gt;role, $db-&gt;dialect, $db-&gt;buffers and $db-&gt;charSet before connecting.</font></td>
     <td><font size="2">Y/N</font></td>
     <td><font size="2">Interbase client</font></td>
     <td><font size="2">Unix and Windows</font></td>
@@ -757,11 +799,19 @@
     <td height="34"><font size="2">?</font></td>
     <td height="34"><font size="2">?</font></td>
   </tr>
+     <tr valign="top"> 
+    <td><b><font size="2">pdo</font></b></td>
+    <td><font size="2">C</font></td>
+    <td><font size="2">Generic PDO driver for PHP5. </font></td>
+    <td><font size="2">Y</font></td>
+    <td><font size="2">PDO extension and database specific drivers</font></td>
+    <td><font size="2">Unix and Windows. </font></td>
+  </tr>
   <tr valign="top"> 
     <td><b><font size="2">postgres</font></b></td>
     <td><font size="2">A</font></td>
     <td><font size="2">Generic PostgreSQL driver. Currently identical to postgres7 
-      driver. </font></td>
+      driver.</font></td>
     <td><font size="2">Y</font></td>
     <td><font size="2">PostgreSQL client</font></td>
     <td><font size="2">Unix and Windows. </font></td>
@@ -783,6 +833,14 @@
     <td><font size="2">PostgreSQL client</font></td>
     <td><font size="2">Unix and Windows. </font></td>
   </tr>
+    <tr valign="top"> 
+    <td><b><font size="2">postgres8</font></b></td>
+    <td><font size="2">A</font></td>
+    <td><font size="2">PostgreSQL which supports version 8 functionality.</font></td>
+    <td><font size="2">Y</font></td>
+    <td><font size="2">PostgreSQL client</font></td>
+    <td><font size="2">Unix and Windows. </font></td>
+  </tr>
   <tr valign="top"> 
     <td><b><font size="2">sapdb</font></b></td>
     <td><font size="2">C</font></td>
@@ -831,9 +889,18 @@
     <td><font size="2">Sybase client</font></td>
     <td> <p><font size="2">Unix and Windows.</font></p></td>
   </tr>
+  
+    <tr valign="top"> 
+    <td><b><font size="2">sybase_ase</font></b></td>
+    <td><font size="2">C</font></td>
+    <td><font size="2">Sybase ASE. </font></td>
+    <td><font size="2">Y/N</font></td>
+    <td><font size="2">Sybase client</font></td>
+    <td> <p><font size="2">Unix and Windows.</font></p></td>
+  </tr>
   </tbody></table>
 
-</p><p>The "Tested" column indicates how extensively the code has been tested 
+<p></p><p>The "Tested" column indicates how extensively the code has been tested 
   and used. <br>
   A = well tested and used by many people<br>
   B = tested and usable, but some features might not be implemented<br>
@@ -944,7 +1011,7 @@
   Note: <i>php_track_errors</i> might have to be enabled for error messages to 
   be saved.</p>
 <h3> Example 4: Debugging<a name="ex4"></a></h3>
-<pre>&lt;?<br><b>include</b>('adodb.inc.php');	   # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('access');	# create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('northwind');   # connect to MS-Access, northwind dsn<br><font color="#000000">$<font color="#663300">shipto</font> = <b>$conn-&gt;qstr</b>("John's Old Shoppe");<br>$<font color="#663300">sql</font> = "insert into orders (customerID,EmployeeID,OrderDate,ShipName) ";<br>$<font color="#663300">sql</font> .= "values ('ANATR',2,".$<font color="#663300">conn</font>-&gt;FormatDate(time()).",$shipto)";<br><b><font color="#336600">$<font color="#663300">conn</font>-&gt;debug = true;</font></b>
+<pre>&lt;?<br><b>include</b>('adodb.inc.php');	   # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('access');	# create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('northwind');   # connect to MS-Access, northwind dsn<br><font>$<font color="#663300">shipto</font> = <b>$conn-&gt;qstr</b>("John's Old Shoppe");<br>$<font color="#663300">sql</font> = "insert into orders (customerID,EmployeeID,OrderDate,ShipName) ";<br>$<font color="#663300">sql</font> .= "values ('ANATR',2,".$<font color="#663300">conn</font>-&gt;FormatDate(time()).",$shipto)";<br><b><font color="#336600">$<font color="#663300">conn</font>-&gt;debug = true;</font></b>
 <b>if</b> ($<font color="#663300">conn</font>-&gt;Execute($sql) <b>=== false</b>) <b>print</b> 'error inserting';</font>
 ?&gt;
 </pre>
@@ -958,7 +1025,7 @@
 <p>Connect to MySQL database <i>agora</i>, and generate a &lt;select&gt; menu 
   from an SQL statement where the &lt;option&gt; captions are in the 1st column, 
   and the value to send back to the server is in the 2nd column.</p>
-<pre>&lt;?<br><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font color="#000000">$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;Execute($sql);<br><b>print</b> <b><font color="#336600">$<font color="#663300">rs</font>-&gt;GetMenu('GetCust','Mary Rosli');<br>?&gt;</font></b></font></pre>
+<pre>&lt;?<br><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;Execute($sql);<br><b>print</b> <b><font color="#336600">$<font color="#663300">rs</font>-&gt;GetMenu('GetCust','Mary Rosli');<br>?&gt;</font></b></font></pre>
 <p>Here we define a menu named GetCust, with the menu option 'Mary Rosli' selected. 
   See <a href="#getmenu"><font face="Courier New, Courier, mono">GetMenu</font></a><font face="Courier New, Courier, mono">()</font>. 
   We also have functions that return the recordset as an array: <font face="Courier New, Courier, mono"><a href="#getarray">GetArray</a>()</font>, 
@@ -967,7 +1034,26 @@
 <pre>&lt;?<br><b>include</b>('adodb.inc.php');	 # load code common to ADOdb<br>$<font color="#663300">conn1</font> = &amp;ADONewConnection('mysql');  # create a mysql connection<br>$<font color="#663300">conn2</font> = &amp;ADONewConnection('oracle');  # create a oracle connection<br><br>$conn1-&gt;PConnect($server, $userid, $password, $database);<br>$conn2-&gt;PConnect(false, $ora_userid, $ora_pwd, $oraname);<br><br>$conn1-&gt;Execute('insert ...');<br>$conn2-&gt;Execute('update ...');<br>?&gt;</pre>
 <p> 
 </p><h3>Example 7: Generating Update and Insert SQL<a name="ex7"></a></h3>
-ADOdb 1.31 and later supports two new recordset functions: GetUpdateSQL( ) and 
+<p>Since ADOdb 4.56, we support <a href="reference.functions.getupdatesql.html#autoexecute">AutoExecute()</a>, 
+which simplifies things by providing an advanced wrapper for GetInsertSQL() and GetUpdateSQL(). For example,
+an INSERT can be carried out with:
+
+<pre>
+    $record["firstname"] = "Bob"; 
+    $record["lastname"] = "Smith"; 
+    $record["created"] = time(); 
+    $insertSQL = $conn->AutoExecute($rs, $record, 'INSERT'); 
+</pre>
+
+and an UPDATE with:
+<pre>
+    $record["firstname"] = "Caroline"; 
+    $record["lastname"] = "Smith"; # Update Caroline's lastname from Miranda to Smith 
+    $insertSQL = $conn->AutoExecute($rs, $record, 'UPDATE', 'WHERE id = 1'); 
+</pre>
+<p>
+The rest of this section is out-of-date:
+<p>ADOdb 1.31 and later supports two new recordset functions: GetUpdateSQL( ) and 
 GetInsertSQL( ). This allow you to perform a "SELECT * FROM table query WHERE...", 
 make a copy of the $rs-&gt;fields, modify the fields, and then generate the SQL to 
 update or insert into the table automatically. 
@@ -981,7 +1067,7 @@
 </p><pre>&lt;?<br>#==============================================<br># SAMPLE GetUpdateSQL() and GetInsertSQL() code<br>#==============================================<br>include('adodb.inc.php');<br>include('tohtml.inc.php');<br><br>#==========================<br># This code tests an insert<br><br>$sql = "SELECT * FROM ADOXYZ WHERE id = -1"; <br># Select an empty record from the database<br><br>$conn = &amp;ADONewConnection("mysql");  # create a connection<br>$conn-&gt;debug=1;<br>$conn-&gt;PConnect("localhost", "admin", "", "test"); # connect to MySQL, testdb<br>$rs = $conn-&gt;Execute($sql); # Execute the query and get the empty recordset<br><br>$record = array(); # Initialize an array to hold the record data to insert<br><br># Set the values for the fields in the record<br># Note that field names are case-insensitive<br>$record["firstname"] = "Bob";<br>$record["lastNamE"] = "Smith";<br>$record["creaTed"] = time();<br><br># Pass the empty recordset and the array containing the data to insert<br># into the GetInsertSQL function. The function will process the data and return<br># a fully formatted insert sql statement.<br>$insertSQL = $conn-&gt;GetInsertSQL($rs, $record);<br><br>$conn-&gt;Execute($insertSQL); # Insert the record into the database<br><br>#==========================<br># This code tests an update<br><br>$sql = "SELECT * FROM ADOXYZ WHERE id = 1"; <br># Select a record to update<br><br>$rs = $conn-&gt;Execute($sql); # Execute the query and get the existing record to update<br><br>$record = array(); # Initialize an array to hold the record data to update<br><br># Set the values for the fields in the record<br># Note that field names are case-insensitive<br>$record["firstname"] = "Caroline";<br>$record["LasTnAme"] = "Smith"; # Update Caroline's lastname from Miranda to Smith<br><br># Pass the single record recordset and the array containing the data to update<br># into the GetUpdateSQL function. The function will process the data and return<br># a fully formatted update sql statement with the correct WHERE clause.<br># If the data has not changed, no recordset is returned<br>$updateSQL = $conn-&gt;GetUpdateSQL($rs, $record);<br><br>$conn-&gt;Execute($updateSQL); # Update the record in the database<br>$conn-&gt;Close();<br>?&gt;<br></pre>
 <a name="ADODB_FORCE_TYPE"></a>
 <b>$ADODB_FORCE_TYPE</b><p>
-The behaviour of GetUpdateSQL() and GetInsertSQL()  
+The behaviour of AutoExecute(), 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):
@@ -991,8 +1077,7 @@
 </p><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><p>
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
 </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 
   from page to page of a recordset.</p>
@@ -1065,7 +1150,7 @@
 <p>We provide some helper functions to export in comma-separated-value (CSV) and 
   tab-delimited formats:</p>
 <pre><b>include_once('/path/to/adodb/toexport.inc.php');</b><br>include_once('/path/to/adodb/adodb.inc.php');<br>
-$db = &amp;NewADOConnection('mysql');<br>$db-&gt;Connect($server, $userid, $password, $database);<br><br>$rs = $db-&gt;Execute('select fname as "First Name", surname as "Surname" from table');<br><br>print "&lt;pre&gt;";<br>print <b>rs2csv</b>($rs); # return a string, CSV format<p>print '&lt;hr&gt;';<br><br>$rs-&gt;MoveFirst(); # note, some databases do not support MoveFirst<br>print <b>rs2tab</b>($rs,<i>false</i>); # return a string, tab-delimited<br>						 # false == suppress field names in first line</p>print '&lt;hr&gt;';<br>$rs-&gt;MoveFirst();<br><b>rs2tabout</b>($rs); # send to stdout directly (there is also an rs2csvout function)<br>print "&lt;/pre&gt;";<br><br>$rs-&gt;MoveFirst();<br><b></b>$fp = fopen($path, "w");<br>if ($fp) {<br>  <b>rs2csvfile</b>($rs, $fp); # write to file (there is also an rs2tabfile function)<br>  fclose($fp);<br>}<br></pre>
+$db = &amp;NewADOConnection('mysql');<br>$db-&gt;Connect($server, $userid, $password, $database);<br><br>$rs = $db-&gt;Execute('select fname as "First Name", surname as "Surname" from table');<br><br>print "&lt;pre&gt;";<br>print <b>rs2csv</b>($rs); # return a string, CSV format<p>print '&lt;hr&gt;';<br><br>$rs-&gt;MoveFirst(); # note, some databases do not support MoveFirst<br>print <b>rs2tab</b>($rs,<i>false</i>); # return a string, tab-delimited<br>						 # false == suppress field names in first line</p>print '&lt;hr&gt;';<br>$rs-&gt;MoveFirst();<br><b>rs2tabout</b>($rs); # send to stdout directly (there is also an rs2csvout function)<br>print "&lt;/pre&gt;";<br><br>$rs-&gt;MoveFirst();<br>$fp = fopen($path, "w");<br>if ($fp) {<br>  <b>rs2csvfile</b>($rs, $fp); # write to file (there is also an rs2tabfile function)<br>  fclose($fp);<br>}<br></pre>
 <p> Carriage-returns or newlines are converted to spaces. Field names are returned 
   in the first line of text. Strings containing the delimiter character are quoted 
   with double-quotes. Double-quotes are double-quoted again. This conforms to 
@@ -1153,6 +1238,7 @@
 </pre>
 The following message will be logged in the error.log file: 
 <pre>(2001-10-28 14:20:38) mysql error: [1146: Table 'northwind.productsz' doesn't exist] in<br> EXECUTE("select * from productsz")<br></pre>
+<h3>PEAR_ERROR</h3>
 The second error handler is <b>adodb-errorpear.inc.php</b>. This will create a 
 PEAR_Error derived object whenever an error occurs. The last PEAR_Error object 
 created can be retrieved using ADODB_Pear_Error(). 
@@ -1176,7 +1262,11 @@
 <p> Note that we do not explicitly return a PEAR_Error object to you when an error 
   occurs. We return false instead. You have to call ADODB_Pear_Error() to get 
   the last error or use the PEAR_ERROR_DIE technique. 
-</p><h4>Error Messages</h4>
+</p>
+<h3>MetaError and MetaErrMsg</h3>
+ <p>If you need error messages that work across multiple databases, then use <a href="#metaerror">MetaError()</a>, which returns a virtualized error number, based on PEAR DB's error number system, and <a href=<a href="#metaerrmsg">MetaErrMsg()</a>.
+
+<h4>Error Messages</h4>
 <p>Error messages are outputted using the static method ADOConnnection::outp($msg,$newline=true). 
   By default, it sends the messages to the client. You can override this to perform 
   error-logging. 
@@ -1189,7 +1279,7 @@
    <p></p>
 <p>   <a href="#dsnsupport">More info and connection examples</a> on the DSN format.
 
- </p><h2><a name="pear"></a>PEAR Compatibility</h2>
+</p><h2><a name="pear"></a>PEAR Compatibility</h2>
   We support DSN's (see above), and the following functions:
  <pre><b> DB_Common</b>
  	query - returns PEAR_Error on error
@@ -1219,13 +1309,13 @@
   ) and CacheSelectLimit( ) functions. There are similar to the non-cache functions, 
   except that they take a new first parameter, $secs2cache. 
 </p><p> An example: 
-</p><pre><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$ADODB_CACHE_DIR = '/usr/ADODB_cache';<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font color="#000000">$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;CacheExecute(15,$sql);</font></pre>
-<p><font color="#000000"> The first parameter is the number of seconds to cache 
+</p><pre><b>include</b>('adodb.inc.php'); # load code common to ADOdb<br>$ADODB_CACHE_DIR = '/usr/ADODB_cache';<br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');  # create a connection<br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br><font>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers';<br>$<font color="#663300">rs</font> = $<font color="#663300">conn</font>-&gt;CacheExecute(15,$sql);</font></pre>
+<p><font> The first parameter is the number of seconds to cache 
   the query. Subsequent calls to that query will used the cached version stored 
   in $ADODB_CACHE_DIR. To force a query to execute and flush the cache, call CacheExecute() 
   with the first parameter set to zero. Alternatively, use the CacheFlush($sql) 
   call. </font></p>
-<p><font color="#000000">For the sake of security, we recommend you set <i>register_globals=off</i> 
+<p><font>For the sake of security, we recommend you set <i>register_globals=off</i> 
   in php.ini if you are using $ADODB_CACHE_DIR.</font></p>
 <p>In ADOdb 1.80 onwards, the secs2cache parameter is optional in CacheSelectLimit() 
   and CacheExecute(). If you leave it out, it will use the $connection-&gt;cacheSecs 
@@ -1233,13 +1323,13 @@
 </p><pre>	$conn-&gt;Connect(...);<br>	$conn-&gt;cacheSecs = 3600*24; # cache 24 hours<br>	$rs = $conn-&gt;CacheExecute('select * from table');<br></pre>
 <p>Please note that magic_quotes_runtime should be turned off. <a href="http://phplens.com/lens/lensforum/msgs.php?LeNs#LensBM_forummsg">More 
   info</a>, and do not change $ADODB_FETCH_MODE (or SetFetchMode) 
-  as the cached recordset will use the $ADODB_FETCH_MODE set when the query was executed. <font color="#000000"> 
+  as the cached recordset will use the $ADODB_FETCH_MODE set when the query was executed. <font> 
 <h2><a name="pivot"></a>Pivot Tables</h2>
-</font> </p><p><font color="#000000">Since ADOdb 2.30, we support the generation of 
+</font> </p><p><font>Since ADOdb 2.30, we support the generation of 
 SQL to create pivot tables, also known as cross-tabulations. For further explanation 
 read this DevShed <a href="http://www.devshed.com/Server_Side/MySQL/MySQLWiz/">Cross-Tabulation 
 tutorial</a>. We assume that your database supports the SQL case-when expression. </font></p> 
-<font color="#000000"> 
+<font> 
 <p>In this example, we will use the Northwind database from Microsoft. In the 
   database, we have a products table, and we want to analyze this table by <i>suppliers 
   versus product categories</i>. We will place the suppliers on each row, and 
@@ -1293,11 +1383,11 @@
 	</td>
   </tr>
 </tbody></table>
-<font color="#000000"> 
-</font><p><font color="#000000">The following code will generate the SQL for a cross-tabulation: 
-</font></p><pre><font color="#000000"># Query the main "product" table<br># Set the rows to CompanyName<br># and the columns to the values of Categories<br># and define the joins to link to lookup tables <br># "categories" and "suppliers"<br>#<br> include "adodb/pivottable.php";<br> $sql = PivotTableSQL(<br> 	$gDB,                                      # adodb connection<br> 	'products p ,categories c ,suppliers s',   # tables<br>	'CompanyName',                             # rows (multiple fields allowed)<br>	'CategoryName',                            # column to pivot on <br>	'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where<br>);<br></font></pre>
+<font> 
+</font><p><font>The following code will generate the SQL for a cross-tabulation: 
+</font></p><pre><font># Query the main "product" table<br># Set the rows to CompanyName<br># and the columns to the values of Categories<br># and define the joins to link to lookup tables <br># "categories" and "suppliers"<br>#<br> include "adodb/pivottable.php";<br> $sql = PivotTableSQL(<br> 	$gDB,                                      # adodb connection<br> 	'products p ,categories c ,suppliers s',   # tables<br>	'CompanyName',                             # rows (multiple fields allowed)<br>	'CategoryName',                            # column to pivot on <br>	'p.CategoryID = c.CategoryID and s.SupplierID= p.SupplierID' # joins/where<br>);<br></font></pre>
  
-<p><font color="#000000"> This will generate the following SQL:</font></p>
+<p><font> This will generate the following SQL:</font></p>
 <p><code><font size="2">SELECT CompanyName, <br>
   SUM(CASE WHEN CategoryName='Beverages' THEN 1 ELSE 0 END) AS "Beverages", 
   <br>
@@ -1320,9 +1410,9 @@
   and s.SupplierID= p.SupplierID <br>
   GROUP BY CompanyName</font></code></p>
 <p> You can also pivot on <i>numerical columns</i> and <i>generate totals</i> 
-	by using ranges. <font color="#000000">This code was revised in ADODB 2.41 
+	by using ranges. <font>This code was revised in ADODB 2.41 
 	and is not backward compatible.</font> The second example shows this:</p>
-<pre> $sql = PivotTableSQL(<br> 	$gDB,                                       # adodb connection<br> 	'products p ,categories c ,suppliers s',    # tables<br>	'CompanyName',                              #<font color="#000000"> rows (multiple fields allowed)</font>
+<pre> $sql = PivotTableSQL(<br> 	$gDB,                                       # adodb connection<br> 	'products p ,categories c ,suppliers s',    # tables<br>	'CompanyName',                              #<font> rows (multiple fields allowed)</font>
    array(                                       # column ranges
 	' 0 '      =&gt; 'UnitsInStock &lt;= 0',
 	"1 to 5"   =&gt; '0 &lt; UnitsInStock and UnitsInStock &lt;= 5',
@@ -1353,12 +1443,12 @@
 	and s.SupplierID= p.SupplierID <br>
 	GROUP BY CompanyName</font></code><font size="2"><br>
 	</font> </p>
-<font color="#000000"><hr>
+<font><hr>
 <h1>Class Reference<a name="ref"></a></h1>
 <p>Function parameters with [ ] around them are optional.</p>
 </font> 
 <h2>Global Variables</h2>
-<h3><font color="#000000"><a name="adodb_countrecs"></a></font>$ADODB_COUNTRECS</h3>
+<h3><font><a name="adodb_countrecs"></a></font>$ADODB_COUNTRECS</h3>
 <p>If the database driver API does not support counting the number of records 
 	returned in a SELECT statement, the function RecordCount() is emulated when 
 	the global variable $ADODB_COUNTRECS is set to true, which is the default. 
@@ -1366,8 +1456,8 @@
 	of memory for big recordsets. Set this variable to false for the best performance. 
 	This variable is checked every time a query is executed, so you can selectively 
 	choose which recordsets to count.</p>
-<h3><font color="#000000"><a name="adodb_cache_dir"></a>$ADODB_CACHE_DIR</font></h3>
-<font color="#000000"> 
+<h3><font><a name="adodb_cache_dir"></a>$ADODB_CACHE_DIR</font></h3>
+<font> 
 <p>If you are using recordset caching, this is the directory to save your recordsets 
   in. Define this before you call any caching functions such as CacheExecute( 
   ). We recommend setting <i>register_globals=off</i> in php.ini if you use this 
@@ -1377,154 +1467,155 @@
 </font> 
 <p>chown -R apache /path/to/adodb/cache<br>
   chgrp -R apache /path/to/adodb/cache </p>
-<font color="#000000">
-</font><h3><font color="#000000"><a name="adodb_ansi_padding_off"></a>$ADODB_ANSI_PADDING_OFF</font></h3>
-<p><font color="#000000">Determines whether to right trim CHAR fields (and also VARCHAR for ibase/firebird).
+<h3><font><a name="adodb_ansi_padding_off"></a>$ADODB_ANSI_PADDING_OFF</font></h3>
+<p><font>Determines whether to right trim CHAR fields (and also VARCHAR for ibase/firebird).
 Set to true to trim. Default is false. Currently works for oci8po, ibase and firebird 
 drivers. Added in ADOdb 4.01.
-</font></p><h3><font color="#000000"><font color="#000000"><a name="adodb_lang"></a></font>$ADODB_LANG</font></h3>
-<p><font color="#000000">Determines the language used in MetaErrorMsg(). The default is 'en', for English. 
+</font></p><h3><font><a name="adodb_lang"></a>$ADODB_LANG</font></h3>
+<p><font>Determines the language used in MetaErrorMsg(). The default is 'en', for English. 
 To find out what languages are supported, see the files 
 in adodb/lang/adodb-$lang.inc.php, where $lang is the supported langauge.
-</font></p><h3><font color="#000000"><a name="adodb_fetch_mode"></a>$ADODB_FETCH_MODE</font></h3>
-<p><font color="#000000">This is a global variable that determines how arrays are retrieved by recordsets. 
+</font></p><h3><font><a name="adodb_fetch_mode"></a>$ADODB_FETCH_MODE</font></h3>
+<p><font>This is a global variable that determines how arrays are retrieved by recordsets. 
   The recordset saves this value on creation (eg. in Execute( ) or SelectLimit( 
   )), and any subsequent changes to $ADODB_FETCH_MODE have no affect on existing 
   recordsets, only on recordsets created in the future.</font></p>
-<p><font color="#000000">The following constants are defined:</font></p>
+<p><font>The following constants are defined:</font></p>
  
-<p><font color="#000000">define('ADODB_FETCH_DEFAULT',0);<br>
+<p><font>define('ADODB_FETCH_DEFAULT',0);<br>
   define('ADODB_FETCH_NUM',1);<br>
   define('ADODB_FETCH_ASSOC',2);<br>
   define('ADODB_FETCH_BOTH',3); </font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"> An example: 
-</font></p><pre><font color="#000000">	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_NUM;<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_ASSOC;<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
+<font> 
+</font><p><font> An example: 
+</font></p><pre><font>	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_NUM;<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$ADODB_<b>FETCH_MODE</b> = ADODB_FETCH_ASSOC;<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
 	print_r($rs2-&gt;fields); # shows <i>array(['col1']=&gt;'v0',['col2'] =&gt;'v1')</i>
 </font></pre>
-<p><font color="#000000"> As you can see in the above example, both recordsets store and use different 
+<p><font> As you can see in the above example, both recordsets store and use different 
 	fetch modes based on the $ADODB_FETCH_MODE setting when the recordset was 
 	created by Execute().</font></p>
-<p><font color="#000000">If no fetch mode is predefined, the fetch mode defaults to ADODB_FETCH_DEFAULT. 
+<p><font>If no fetch mode is predefined, the fetch mode defaults to ADODB_FETCH_DEFAULT. 
 	The behaviour of this default mode varies from driver to driver, so do not 
 	rely on ADODB_FETCH_DEFAULT. For portability, we recommend sticking to ADODB_FETCH_NUM 
 	or ADODB_FETCH_ASSOC. Many drivers do not support ADODB_FETCH_BOTH.</font></p>
-<p><font color="#000000"><strong>SetFetchMode Function</strong></font></p>
-<p><font color="#000000">Some programmers prefer to use a more object-oriented solution, where the fetch 
-	mode is set by a object function, <a href="#setfetchmode">SetFetchMode</a>. 
+<p><font><strong>SetFetchMode Function</strong></font></p>
+<p><font>If you have multiple connection objects, and want to have different fetch modes for each 
+connection, then use <a href="#setfetchmode">SetFetchMode</a>. 
 	Once this function is called for a connection object, that connection object 
 	will ignore the global variable $ADODB_FETCH_MODE and will use the internal 
 	fetchMode property exclusively.</font></p>
-<pre><font color="#000000">	$db-&gt;SetFetchMode(ADODB_FETCH_NUM);<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$db-&gt;SetFetchMode(ADODB_FETCH_ASSOC);<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
+<pre><font>	$db-&gt;SetFetchMode(ADODB_FETCH_NUM);<br>	$rs1 = $db-&gt;Execute('select * from table');<br>	$db-&gt;SetFetchMode(ADODB_FETCH_ASSOC);<br>	$rs2 = $db-&gt;Execute('select * from table');<br>	print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i>
 	print_r($rs2-&gt;fields); # shows <i>array(['col1']=&gt;'v0',['col2'] =&gt;'v1')</i></font></pre>
-<p><font color="#000000">To retrieve the previous fetch mode, you can use check the $db-&gt;fetchMode 
+<p><font>To retrieve the previous fetch mode, you can use check the $db-&gt;fetchMode 
 	property, or use the return value of SetFetchMode( ). 
-</font></p><p><font color="#000000"><strong><a name="adodb_assoc_case"></a>ADODB_ASSOC_CASE</strong></font></p>
-<p><font color="#000000">You can control the associative fetch case for certain drivers which behave 
+</font></p><p><font><strong><a name="adodb_assoc_case"></a>ADODB_ASSOC_CASE</strong></font></p>
+<p><font>You can control the associative fetch case for certain drivers which behave 
 	differently. For the sybase, oci8po, mssql, odbc and ibase drivers and all 
 	drivers derived from them, ADODB_ASSOC_CASE will by default generate recordsets 
 	where the field name keys are lower-cased. Use the constant ADODB_ASSOC_CASE 
 	to change the case of the keys. There are 3 possible values:</font></p>
-<p><font color="#000000">0 = assoc lowercase field names. $rs-&gt;fields['orderid']<br>
+<p><font>0 = assoc lowercase field names. $rs-&gt;fields['orderid']<br>
 	1 = assoc uppercase field names. $rs-&gt;fields['ORDERID']<br>
 	2 = use native-case field names. $rs-&gt;fields['OrderID'] -- this is the 
 	default since ADOdb 2.90</font></p>
-<p><font color="#000000">To use it, declare it before you incldue adodb.inc.php.</font></p>
-<p><font color="#000000">define('ADODB_ASSOC_CASE', 2); # use native-case for ADODB_FETCH_ASSOC<br>
+<p><font>To use it, declare it before you incldue adodb.inc.php.</font></p>
+<p><font>define('ADODB_ASSOC_CASE', 2); # use native-case for ADODB_FETCH_ASSOC<br>
 	include('adodb.inc.php'); </font></p>
-<h3><font color="#000000"><font color="#000000"><a name="force_type"></a></font>$ADODB_FORCE_TYPE</font></h3>
-<p><font color="#000000">See the <a href="#ADODB_FORCE_TYPE">GetUpdateSQL tutorial</a>.
+<h3><font><a name="force_type"></a>$ADODB_FORCE_TYPE</font></h3>
+<p><font>See the <a href="#ADODB_FORCE_TYPE">GetUpdateSQL tutorial</a>.
 </font></p><hr>
-<h2><font color="#000000">ADOConnection<a name="adoconnection"></a></font></h2>
-<p><font color="#000000">Object that performs the connection to the database, executes SQL statements 
+<h2><font>ADOConnection<a name="adoconnection"></a></font></h2>
+<p><font>Object that performs the connection to the database, executes SQL statements 
 	and has a set of utility functions for standardising the format of SQL statements 
 	for issues such as concatenation and date formats.</font></p>
-<h3><font color="#000000">ADOConnection Fields</font></h3>
-<p><font color="#000000"><b>databaseType</b>: Name of the database system we are connecting to. Eg. 
+<h3><font>ADOConnection Fields</font></h3>
+<p><font><b>databaseType</b>: Name of the database system we are connecting to. Eg. 
 	<b>odbc</b> or <b>mssql</b> or <b>mysql</b>.</font></p>
-<p><font color="#000000"><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
+<p><font><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
 	Normally set to <b>native</b>, unless using <b>odbc</b> or <b>ado</b>.</font></p>
-<p><font color="#000000"><b>host: </b>Name of server or data source name (DSN) to connect to.</font></p>
-<p><font color="#000000"><b>database</b>: Name of the database or to connect to. If ado is used, it 
+<p><font><b>host: </b>Name of server or data source name (DSN) to connect to.</font></p>
+<p><font><b>database</b>: Name of the database or to connect to. If ado is used, it 
 	will hold the ado data provider.</font></p>
-<p><font color="#000000"><b>user</b>: Login id to connect to database. Password is not saved for security 
+<p><font><b>user</b>: Login id to connect to database. Password is not saved for security 
 	reasons.</font></p>
-<p><font color="#000000"><b>raiseErrorFn</b>: Allows you to define an error handling function. See adodb-errorhandler.inc.php 
+<p><font><b>raiseErrorFn</b>: Allows you to define an error handling function. See adodb-errorhandler.inc.php 
 	for an example.</font></p>
-<p><font color="#000000"><b>debug</b>: Set to <i>true</i> to make debug statements to appear.</font></p>
-<p><font color="#000000"><b>concat_operator</b>: Set to '+' or '||' normally. The operator used to concatenate 
+<p><font><b>debug</b>: Set to <i>true</i> to make debug statements to appear.</font></p>
+<p><font><b>concat_operator</b>: Set to '+' or '||' normally. The operator used to concatenate 
 	strings in SQL. Used by the <b><a href="#concat">Concat</a></b> function.</font></p>
-<p><font color="#000000"><b>fmtDate</b>: The format used by the <b><a href="#dbdate">DBDate</a></b> 
+<p><font><b>fmtDate</b>: The format used by the <b><a href="#dbdate">DBDate</a></b> 
 	function to send dates to the database. is '#Y-m-d#' for Microsoft Access, 
 	and ''Y-m-d'' for MySQL.</font></p>
-<p><font color="#000000"><b>fmtTimeStamp: </b>The format used by the <b><a href="#dbtimestamp">DBTimeStamp</a></b> 
+<p><font><b>fmtTimeStamp: </b>The format used by the <b><a href="#dbtimestamp">DBTimeStamp</a></b> 
 	function to send timestamps to the database. </font></p>
-<p><font color="#000000"><b>true</b>: The value used to represent true.Eg. '.T.'. for Foxpro, '1' for 
+<p><font><b>true</b>: The value used to represent true.Eg. '.T.'. for Foxpro, '1' for 
 	Microsoft SQL.</font></p>
-<p><font color="#000000"><b>false: </b> The value used to represent false. Eg. '.F.'. for Foxpro, '0' 
+<p><font><b>false: </b> The value used to represent false. Eg. '.F.'. for Foxpro, '0' 
 	for Microsoft SQL.</font></p>
-<p><font color="#000000"><b>replaceQuote</b>: The string used to escape quotes. Eg. double single-quotes 
+<p><font><b>replaceQuote</b>: The string used to escape quotes. Eg. double single-quotes 
 	for Microsoft SQL, and backslash-quote for MySQL. Used by <a href="#qstr">qstr</a>.</font></p>
-<p><font color="#000000"><b>autoCommit</b>: indicates whether automatic commit is enabled. Default is 
+<p><font><b>autoCommit</b>: indicates whether automatic commit is enabled. Default is 
 	true.</font></p>
-<p><font color="#000000"><b>charSet</b>: set the default charset to use. Currently only interbase supports 
+<p><font><b>charSet</b>: set the default charset to use. Currently only interbase/firebird supports 
 	this.</font></p>
-<p><font color="#000000"><b>dialect</b>: set the default sql dialect to use. Currently only interbase 
+<p><font><b>dialect</b>: set the default sql dialect to use. Currently only interbase/firebird 
 	supports this.</font></p>
-<p><font color="#000000"><b>metaTablesSQL</b>: SQL statement to return a list of available tables. Eg. 
+	<p><font><b>role</b>: set the role. Currently only interbase/firebird 
+	supports this.</font></p>
+<p><font><b>metaTablesSQL</b>: SQL statement to return a list of available tables. Eg. 
 	<i>SHOW TABLES</i> in MySQL.</font></p>
-<p><font color="#000000"><b>genID</b>: The latest id generated by GenID() if supported by the database.</font></p>
-<p><font color="#000000"><b>cacheSecs</b>: The number of seconds to cache recordsets if CacheExecute() 
+<p><font><b>genID</b>: The latest id generated by GenID() if supported by the database.</font></p>
+<p><font><b>cacheSecs</b>: The number of seconds to cache recordsets if CacheExecute() 
 	or CacheSelectLimit() omit the $secs2cache parameter. Defaults to 60 minutes.</font></p>
-<p><font color="#000000"><b>sysDate</b>: String that holds the name of the database function to call 
+<p><font><b>sysDate</b>: String that holds the name of the database function to call 
 	to get the current date. Useful for inserts and updates.</font></p>
-<p><font color="#000000"><b>sysTimeStamp</b>: String that holds the name of the database function to 
+<p><font><b>sysTimeStamp</b>: String that holds the name of the database function to 
 	call to get the current timestamp/datetime value.</font></p>
-<p><font color="#000000"><b>leftOuter</b>: String that holds operator for left outer join, if known. 
+<p><font><b>leftOuter</b>: String that holds operator for left outer join, if known. 
 	Otherwise set to false.</font></p>
-<p><font color="#000000"><b>rightOuter</b>: String that holds operator for left outer join, if known. 
+<p><font><b>rightOuter</b>: String that holds operator for left outer join, if known. 
 	Otherwise set to false.</font></p>
-<p><font color="#000000"><b>ansiOuter</b>: Boolean that if true indicates that ANSI style outer joins 
+<p><font><b>ansiOuter</b>: Boolean that if true indicates that ANSI style outer joins 
 	are permitted. Eg. <i>select * from table1 left join table2 on p1=p2.</i></font></p>
-<p><font color="#000000"><b>connectSID</b>: Boolean that indicates whether to treat the $database parameter 
+<p><font><b>connectSID</b>: Boolean that indicates whether to treat the $database parameter 
 	in connects as the SID for the oci8 driver. Defaults to false. Useful for 
 	Oracle 8.0.5 and earlier.</font></p>
-<p><font color="#000000"><b>autoRollback</b>: Persistent connections are auto-rollbacked in PConnect( 
+<p><font><b>autoRollback</b>: Persistent connections are auto-rollbacked in PConnect( 
 	) if this is set to true. Default is false.</font></p>
 <hr>
-<h3><font color="#000000">ADOConnection Main Functions</font></h3>
-<p><font color="#000000"><b>ADOConnection( )</b></font></p>
-<p><font color="#000000">Constructor function. Do not call this directly. Use ADONewConnection( ) instead.</font></p>
-<p><font color="#000000"><b>Connect<a name="connect"></a>($host,[$user],[$password],[$database])</b></font></p>
-<p><font color="#000000">Non-persistent connect to data source or server $<b>host</b>, using userid 
+<h3><font>ADOConnection Main Functions</font></h3>
+<p><font><b>ADOConnection( )</b></font></p>
+<p><font>Constructor function. Do not call this directly. Use ADONewConnection( ) instead.</font></p>
+<p><font><b>Connect<a name="connect"></a>($host,[$user],[$password],[$database])</b></font></p>
+<p><font>Non-persistent connect to data source or server $<b>host</b>, using userid 
 	$<b>user </b>and password $<b>password</b>. If the server supports multiple 
 	databases, connect to database $<b>database</b>. </font></p>
-<p><font color="#000000">Returns true/false depending on connection success. Since 4.23, null is returned if the extension is not loaded.</font></p>
-<p><font color="#000000">ADO Note: If you are using a Microsoft ADO and not OLEDB, you can set the $database 
+<p><font>Returns true/false depending on connection success. Since 4.23, null is returned if the extension is not loaded.</font></p>
+<p><font>ADO Note: If you are using a Microsoft ADO and not OLEDB, you can set the $database 
 	parameter to the OLEDB data provider you are using.</font></p>
-<p><font color="#000000">PostgreSQL: An alternative way of connecting to the database is to pass the 
+<p><font>PostgreSQL: An alternative way of connecting to the database is to pass the 
 	standard PostgreSQL connection string in the first parameter $host, and the 
 	other parameters will be ignored.</font></p>
-<p><font color="#000000">For Oracle and Oci8, there are two ways to connect. First is to use the TNS 
+<p><font>For Oracle and Oci8, there are two ways to connect. First is to use the TNS 
 	name defined in your local tnsnames.ora (or ONAMES or HOSTNAMES). Place the 
 	name in the $database field, and set the $host field to false. Alternatively, 
 	set $host to the server, and $database to the database SID, this bypassed 
 	tnsnames.ora. 
-</font></p><p><font color="#000000">Examples: 
-</font></p><pre><font color="#000000"> # $oraname in tnsnames.ora/ONAMES/HOSTNAMES<br> $conn-&gt;Connect(false, 'scott', 'tiger', $oraname); <br> $conn-&gt;Connect('server:1521', 'scott', 'tiger', 'ServiceName'); # bypass tnsnames.ora</font></pre>
-<p><font color="#000000">There are many examples of connecting to a database.
+</font></p><p><font>Examples: 
+</font></p><pre><font> # $oraname in tnsnames.ora/ONAMES/HOSTNAMES<br> $conn-&gt;Connect(false, 'scott', 'tiger', $oraname); <br> $conn-&gt;Connect('server:1521', 'scott', 'tiger', 'ServiceName'); # bypass tnsnames.ora</font></pre>
+<p><font>There are many examples of connecting to a database.
 See  <a href="#connect_ex">Connection Examples</a> for many examples.
 
-</font></p><p><font color="#000000"><b>PConnect<a name="pconnect"></a>($host,[$user],[$password],[$database])</b></font></p>
-<p><font color="#000000">Persistent connect to data source or server $<b>host</b>, using userid $<b>user</b> 
+</font></p><p><font><b>PConnect<a name="pconnect"></a>($host,[$user],[$password],[$database])</b></font></p>
+<p><font>Persistent connect to data source or server $<b>host</b>, using userid $<b>user</b> 
 	and password $<b>password</b>. If the server supports multiple databases, 
 	connect to database $<b>database</b>.</font></p>
-<p><font color="#000000">We now perform a rollback on persistent connection for selected databases since 
+<p><font>We now perform a rollback on persistent connection for selected databases since 
 	2.21, as advised in the PHP manual. See change log or source code for which 
 	databases are affected. 
-</font></p><p><font color="#000000">Returns true/false depending on connection. Since 4.23, null is returned if the extension is not loaded.
+</font></p><p><font>Returns true/false depending on connection. Since 4.23, null is returned if the extension is not loaded.
 See Connect( ) above for more info.</font></p>
-<p><font color="#000000">Since ADOdb 2.21, we also support autoRollback. If you set:</font></p>
+<p><font>Since ADOdb 2.21, we also support autoRollback. If you set:</font></p>
  
 <pre> $conn = &amp;NewADOConnection('mysql');<br> $conn-&gt;autoRollback = true; # default is false<br> $conn-&gt;PConnect(...); # rollback here</pre>
 <p> Then when doing a persistent connection with PConnect( ), ADOdb will 
@@ -1541,111 +1632,110 @@
 <p>Always force a new connection. In contrast, PHP sometimes reuses connections 
 	when you use Connect() or PConnect(). Currently works only on mysql (PHP 4.3.0 
 	or later), postgresql and oci8-derived drivers. For other drivers, NConnect() works like 
-	Connect(). 
-<font color="#000000"> 
-</font></p><p><font color="#000000"><b>IsConnected( )<a name="isconnected"></a></b></font></p>
+	Connect().</p>
+<p><font><b>IsConnected( )<a name="isconnected"></a></b></font></p>
 <p>
-<font color="#000000">Returns true if connected to database. Added in 4.53.
+<font>Returns true if connected to database. Added in 4.53.
 
-</font></p><p><font color="#000000"><b>Execute<a name="execute"></a>($sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Execute SQL statement $<b>sql</b> and return derived class of ADORecordSet 
+</font></p><p><font><b>Execute<a name="execute"></a>($sql,$inputarr=false)</b></font></p>
+<p><font>Execute SQL statement $<b>sql</b> and return derived class of ADORecordSet 
 	if successful. Note that a record set is always returned on success, even 
 	if we are executing an insert or update statement. You can also pass in $sql a statement prepared 
 	in <a href="#prepare">Prepare()</a>.</font></p>
-<p><font color="#000000">Returns derived class of ADORecordSet. Eg. if connecting via mysql, then ADORecordSet_mysql 
+<p><font>Returns derived class of ADORecordSet. Eg. if connecting via mysql, then ADORecordSet_mysql 
 	would be returned. False is returned if there was an error in executing the 
 	sql.</font></p>
-<p><font color="#000000">The $inputarr parameter can be used for binding variables to parameters. Below 
+<p><font>The $inputarr parameter can be used for binding variables to parameters. Below 
 	is an Oracle example:</font></p>
-<pre><font color="#000000"> $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=:val", array('val'=&gt; $val));<br> </font></pre>
-<p><font color="#000000">Another example, using ODBC,which uses the ? convention:</font></p>
-<pre><font color="#000000">  $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=?", array($val));<br></font></pre>
-<font color="#000000"><a name="binding"></a>
+<pre><font> $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=:val", array('val'=&gt; $val));<br> </font></pre>
+<p><font>Another example, using ODBC,which uses the ? convention:</font></p>
+<pre><font>  $conn-&gt;Execute("SELECT * FROM TABLE WHERE COND=?", array($val));<br></font></pre>
+<font><a name="binding"></a>
 <i>Binding variables</i></font><p>
-<font color="#000000">Variable binding speeds the compilation and caching of SQL statements, leading 
+<font>Variable binding speeds the compilation and caching of SQL statements, leading 
 to higher performance. Currently Oracle, Interbase and ODBC supports variable binding. 
 Interbase/ODBC style ? binding is emulated in databases that do not support binding. 
 Note that you do not have to quote strings if you use binding.
-</font></p><p><font color="#000000"> Variable binding in the odbc, interbase and oci8po drivers. 
-</font></p><pre><font color="#000000">$rs = $db-&gt;Execute('select * from table where val=?', array('10'));<br></font></pre>
-<font color="#000000">Variable binding in the oci8 driver: 
-</font><pre><font color="#000000">$rs = $db-&gt;Execute('select name from table where val=:key', <br>  array('key' =&gt; 10));<br></font></pre>
-<font color="#000000"><a name="bulkbind"></a>
+</font></p><p><font> Variable binding in the odbc, interbase and oci8po drivers. 
+</font></p><pre><font>$rs = $db-&gt;Execute('select * from table where val=?', array('10'));<br></font></pre>
+<font>Variable binding in the oci8 driver: 
+</font><pre><font>$rs = $db-&gt;Execute('select name from table where val=:key', <br>  array('key' =&gt; 10));<br></font></pre>
+<font><a name="bulkbind"></a>
 <i>Bulk binding</i>
-</font><p><font color="#000000">Since ADOdb 3.80, we support bulk binding in Execute(), in which you pass in a 2-dimensional array to
+</font><p><font>Since ADOdb 3.80, we support bulk binding in Execute(), in which you pass in a 2-dimensional array to
 be bound to an INSERT/UPDATE or DELETE statement.
-</font></p><pre><font color="#000000">$arr = array(<br>	array('Ahmad',32),<br>	array('Zulkifli', 24),<br>	array('Rosnah', 21)<br>	);<br>$ok = $db-&gt;Execute('insert into table (name,age) values (?,?)',$arr);<br></font></pre>
-<p><font color="#000000">This provides very high performance as the SQL statement is prepared first. 
+</font></p><pre><font>$arr = array(<br>	array('Ahmad',32),<br>	array('Zulkifli', 24),<br>	array('Rosnah', 21)<br>	);<br>$ok = $db-&gt;Execute('insert into table (name,age) values (?,?)',$arr);<br></font></pre>
+<p><font>This provides very high performance as the SQL statement is prepared first. 
 The prepared statement is executed repeatedly for each array row until all rows are completed, 
 or until the first error. Very useful for importing data.
 
-</font></p><p><font color="#000000"><b>CacheExecute<a name="cacheexecute"></a>([$secs2cache,]$sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Similar to Execute, except that the recordset is cached for $secs2cache seconds 
+</font></p><p><font><b>CacheExecute<a name="cacheexecute"></a>([$secs2cache,]$sql,$inputarr=false)</b></font></p>
+<p><font>Similar to Execute, except that the recordset is cached for $secs2cache seconds 
 	in the $ADODB_CACHE_DIR directory, and $inputarr only accepts 1-dimensional arrays. 
 	If CacheExecute() is called again with the same $sql, $inputarr, 
 	and also the same database, same userid, and the cached recordset 
 	has not expired, the cached recordset is returned. 
-</font></p><pre><font color="#000000">  include('adodb.inc.php'); <br>  include('tohtml.inc.php');<br>  $ADODB_<b>CACHE_DIR</b> = '/usr/local/ADOdbcache';<br>  $conn = &amp;ADONewConnection('mysql'); <br>  $conn-&gt;PConnect('localhost','userid','password','database');<br>  $rs = $conn-&gt;<b>CacheExecute</b>(15, 'select * from table'); # cache 15 secs<br>  rs2html($rs); /* recordset to html table */  <br></font></pre>
-<p><font color="#000000"> Alternatively, since ADOdb 1.80, the $secs2cache parameter is optional:</font></p>
-<pre><font color="#000000">	$conn-&gt;Connect(...);<br>   	$conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheExecute('select * from table');<br></font></pre>
-<font color="#000000">If $secs2cache is omitted, we use the value 
+</font></p><pre><font>  include('adodb.inc.php'); <br>  include('tohtml.inc.php');<br>  $ADODB_<b>CACHE_DIR</b> = '/usr/local/ADOdbcache';<br>  $conn = &amp;ADONewConnection('mysql'); <br>  $conn-&gt;PConnect('localhost','userid','password','database');<br>  $rs = $conn-&gt;<b>CacheExecute</b>(15, 'select * from table'); # cache 15 secs<br>  rs2html($rs); /* recordset to html table */  <br></font></pre>
+<p><font> Alternatively, since ADOdb 1.80, the $secs2cache parameter is optional:</font></p>
+<pre><font>	$conn-&gt;Connect(...);<br>   	$conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheExecute('select * from table');<br></font></pre>
+<font>If $secs2cache is omitted, we use the value 
 in $connection-&gt;cacheSecs (default is 3600 seconds, or 1 hour). Use CacheExecute() 
 only with SELECT statements. 
-</font><p><font color="#000000">Performance note: I have done some benchmarks and found that they vary so greatly 
+</font><p><font>Performance note: I have done some benchmarks and found that they vary so greatly 
 	that it's better to talk about when caching is of benefit. When your database 
 	server is <i>much slower </i>than your Web server or the database is <i>very 
 	overloaded </i>then ADOdb's caching is good because it reduces the load on 
 	your database server. If your database server is lightly loaded or much faster 
 	than your Web server, then caching could actually reduce performance. </font></p>
-<p><font color="#000000"><b>ExecuteCursor<a name="executecursor"></a>($sql,$cursorName='rs',$parameters=false)</b></font></p>
-<p><font color="#000000">Execute an Oracle stored procedure, and returns an Oracle REF cursor variable as 
+<p><font><b>ExecuteCursor<a name="executecursor"></a>($sql,$cursorName='rs',$parameters=false)</b></font></p>
+<p><font>Execute an Oracle stored procedure, and returns an Oracle REF cursor variable as 
 	a regular ADOdb recordset. Does not work with any other database except oci8. 
 	Thanks to Robert Tuttle for the design.
-</font></p><pre><font color="#000000">    $db = ADONewConnection("oci8"); <br>    $db-&gt;Connect("foo.com:1521", "uid", "pwd", "FOO"); <br>    $rs = $db-&gt;ExecuteCursor("begin :cursorvar := getdata(:param1); end;", <br>					'cursorvar',<br>					array('param1'=&gt;10)); <br>    # $rs is now just like any other ADOdb recordset object<br>    rs2html($rs);</font></pre>
-<p><font color="#000000">ExecuteCursor() is a helper function that does the following internally: 
-</font></p><pre><font color="#000000">	$stmt = $db-&gt;Prepare("begin :cursorvar := getdata(:param1); end;", true); <br>	$db-&gt;Parameter($stmt, $cur, 'cursorvar', false, -1, OCI_B_CURSOR);<br>	$rs = $db-&gt;Execute($stmt,$bindarr);<br></font></pre>
-<p><font color="#000000">ExecuteCursor only accepts 1 out parameter. So if you have 2 out parameters, use:
-</font></p><pre><font color="#000000">	$vv = 'A%';<br>	$stmt = $db-&gt;PrepareSP("BEGIN list_tabs(:crsr,:tt); END;");<br>	$db-&gt;OutParameter($stmt, $cur, 'crsr', -1, OCI_B_CURSOR);<br>	$db-&gt;OutParameter($stmt, $vv, 'tt', 32); # return varchar(32)<br>	$arr = $db-&gt;GetArray($stmt);<br>	print_r($arr);<br>	echo " val = $vv"; ## outputs 'TEST'<br></font></pre>
-<font color="#000000">for the following PL/SQL:
-</font><pre><font color="#000000">	TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;<br><br>	PROCEDURE list_tabs(tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) IS<br>	BEGIN<br>		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;<br>		tablenames := 'TEST';<br>	END list_tabs;<br></font></pre>
-<p><font color="#000000"><b>SelectLimit<a name="selectlimit"></a>($sql,$numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
-<p><font color="#000000">Returns a recordset if successful. Returns false otherwise. Performs a select 
+</font></p><pre><font>    $db = ADONewConnection("oci8"); <br>    $db-&gt;Connect("foo.com:1521", "uid", "pwd", "FOO"); <br>    $rs = $db-&gt;ExecuteCursor("begin :cursorvar := getdata(:param1); end;", <br>					'cursorvar',<br>					array('param1'=&gt;10)); <br>    # $rs is now just like any other ADOdb recordset object<br>    rs2html($rs);</font></pre>
+<p><font>ExecuteCursor() is a helper function that does the following internally: 
+</font></p><pre><font>	$stmt = $db-&gt;Prepare("begin :cursorvar := getdata(:param1); end;", true); <br>	$db-&gt;Parameter($stmt, $cur, 'cursorvar', false, -1, OCI_B_CURSOR);<br>	$rs = $db-&gt;Execute($stmt,$bindarr);<br></font></pre>
+<p><font>ExecuteCursor only accepts 1 out parameter. So if you have 2 out parameters, use:
+</font></p><pre><font>	$vv = 'A%';<br>	$stmt = $db-&gt;PrepareSP("BEGIN list_tabs(:crsr,:tt); END;");<br>	$db-&gt;OutParameter($stmt, $cur, 'crsr', -1, OCI_B_CURSOR);<br>	$db-&gt;OutParameter($stmt, $vv, 'tt', 32); # return varchar(32)<br>	$arr = $db-&gt;GetArray($stmt);<br>	print_r($arr);<br>	echo " val = $vv"; ## outputs 'TEST'<br></font></pre>
+<font>for the following PL/SQL:
+</font><pre><font>	TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;<br><br>	PROCEDURE list_tabs(tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) IS<br>	BEGIN<br>		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;<br>		tablenames := 'TEST';<br>	END list_tabs;<br></font></pre>
+<p><font><b>SelectLimit<a name="selectlimit"></a>($sql,$numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
+<p><font>Returns a recordset if successful. Returns false otherwise. Performs a select 
 	statement, simulating PostgreSQL's SELECT statement, LIMIT $numrows OFFSET 
 	$offset clause.</font></p>
-<p><font color="#000000">In PostgreSQL, SELECT * FROM TABLE LIMIT 3 will return the first 3 records 
+<p><font>In PostgreSQL, SELECT * FROM TABLE LIMIT 3 will return the first 3 records 
 	only. The equivalent is <code>$connection-&gt;SelectLimit('SELECT * FROM TABLE',3)</code>. 
 	This functionality is simulated for databases that do not possess this feature.</font></p>
-<p><font color="#000000">And SELECT * FROM TABLE LIMIT 3 OFFSET 2 will return records 3, 4 and 5 (eg. 
+<p><font>And SELECT * FROM TABLE LIMIT 3 OFFSET 2 will return records 3, 4 and 5 (eg. 
 	after record 2, return 3 rows). The equivalent in ADOdb is <code>$connection-&gt;SelectLimit('SELECT 
 	* FROM TABLE',3,2)</code>.</font></p>
-<p><font color="#000000">Note that this is the <i>opposite</i> of MySQL's LIMIT clause. You can also 
+<p><font>Note that this is the <i>opposite</i> of MySQL's LIMIT clause. You can also 
 	set <code>$connection-&gt;SelectLimit('SELECT * FROM TABLE',-1,10)</code> to 
 	get rows 11 to the last row.</font></p>
-<p><font color="#000000">The last parameter $inputarr is for databases that support variable binding 
+<p><font>The last parameter $inputarr is for databases that support variable binding 
 	such as Oracle oci8. This substantially reduces SQL compilation overhead. 
 	Below is an Oracle example:</font></p>
-<pre><font color="#000000"> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=:val", 100,-1,array('val'=&gt; $val));<br> </font></pre>
-<p><font color="#000000">The oci8po driver (oracle portable driver) uses the more standard bind variable 
+<pre><font> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=:val", 100,-1,array('val'=&gt; $val));<br> </font></pre>
+<p><font>The oci8po driver (oracle portable driver) uses the more standard bind variable 
 	of ?: 
-</font></p><pre><font color="#000000"> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=?", 100,-1,array('val'=&gt; $val));<br></font></pre>
-<p><font color="#000000"> 
-</font></p><p><font color="#000000">Ron Wilson reports that SelectLimit does not work with UNIONs. 
-</font></p><p><font color="#000000"><b>CacheSelectLimit<a name="cacheselectlimit"></a>([$secs2cache,] $sql, $numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
-<p><font color="#000000">Similar to SelectLimit, except that the recordset returned is cached for $secs2cache 
+</font></p><pre><font> $conn-&gt;SelectLimit("SELECT * FROM TABLE WHERE COND=?", 100,-1,array('val'=&gt; $val));<br></font></pre>
+<p><font> 
+</font></p><p><font>Ron Wilson reports that SelectLimit does not work with UNIONs. 
+</font></p><p><font><b>CacheSelectLimit<a name="cacheselectlimit"></a>([$secs2cache,] $sql, $numrows=-1,$offset=-1,$inputarr=false)</b></font></p>
+<p><font>Similar to SelectLimit, except that the recordset returned is cached for $secs2cache 
 	seconds in the $ADODB_CACHE_DIR directory. </font></p>
-<p><font color="#000000">Since 1.80, $secs2cache has been optional, and you can define the caching time 
+<p><font>Since 1.80, $secs2cache has been optional, and you can define the caching time 
 	in $connection-&gt;cacheSecs.</font></p>
  
-<pre><font color="#000000">	$conn-&gt;Connect(...);<br>   $conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheSelectLimit('select * from table',10);</font></pre>
-<font color="#000000"> 
-</font><p><font color="#000000"><b>CacheFlush<a name="cacheflush"></a>($sql=false,$inputarr=false)</b></font></p>
-<p><font color="#000000">Flush (delete) any cached recordsets for the SQL statement $sql in $ADODB_CACHE_DIR. 
-</font></p><p><font color="#000000">If no parameter is passed in, then all adodb_*.cache files are deleted. 
-</font></p><p><font color="#000000"> If you want to flush all cached recordsets manually, execute the following 
+<pre><font>	$conn-&gt;Connect(...);<br>   $conn-&gt;cacheSecs = 3600*24; // cache 24 hours<br>	$rs = $conn-&gt;CacheSelectLimit('select * from table',10);</font></pre>
+<font> 
+</font><p><font><b>CacheFlush<a name="cacheflush"></a>($sql=false,$inputarr=false)</b></font></p>
+<p><font>Flush (delete) any cached recordsets for the SQL statement $sql in $ADODB_CACHE_DIR. 
+</font></p><p><font>If no parameter is passed in, then all adodb_*.cache files are deleted. 
+</font></p><p><font> If you want to flush all cached recordsets manually, execute the following 
 	PHP code (works only under Unix): <br>
 	<code> &nbsp; system("rm -f `find ".$ADODB_CACHE_DIR." -name 
 	adodb_*.cache`");</code></font></p>
-<p><font color="#000000">For general cleanup of all expired files, you should use <a href="http://www.superscripts.com/tutorial/crontab.html">crontab</a> 
+<p><font>For general cleanup of all expired files, you should use <a href="http://www.superscripts.com/tutorial/crontab.html">crontab</a> 
 	on Unix, or at.exe on Windows, and a shell script similar to the following:<font face="Courier New, Courier, mono"><br>
 	#------------------------------------------------------ <br>
 	# This particular example deletes files in the TMPPATH <br>
@@ -1655,398 +1745,438 @@
 	AGED=7 <br>
 	find ${TMPPATH} -mtime +$AGED | grep "\.cache" | xargs rm -f <br>
 	</font> </font></p>
-<p><font color="#000000"><b>MetaError<a name="metaerror"></a>($errno=false)</b></font></p>
-<p><font color="#000000">Returns a virtualized error number, based on PEAR DB's error number system. You might
+<p><font><b>MetaError<a name="metaerror"></a>($errno=false)</b></font></p>
+<p><font>Returns a virtualized error number, based on PEAR DB's error number system. You might
 need to include adodb-error.inc.php before you call this function. The parameter $errno
 is the native error number you want to convert. If you do not pass any parameter, MetaError
 will call ErrorNo() for you and convert it. If the error number cannot be virtualized, MetaError 
 will return -1 (DB_ERROR).</font></p>
 
-<p><font color="#000000"><b>MetaErrorMsg<a name="metaerrormsg"></a>($errno)</b></font></p>
-<p><font color="#000000">Pass the error number returned by MetaError() for the equivalent textual error message.</font></p>
-<p><font color="#000000"><b>ErrorMsg<a name="errormsg"></a>()</b></font></p>
-<p><font color="#000000">Returns the last status or error message. The error message is reset after every 
+<p><font><b>MetaErrorMsg<a name="metaerrormsg"></a>($errno)</b></font></p>
+<p><font>Pass the error number returned by MetaError() for the equivalent textual error message.</font></p>
+<p><font><b>ErrorMsg<a name="errormsg"></a>()</b></font></p>
+<p><font>Returns the last status or error message. The error message is reset after every 
 call to Execute(). 
 </font></p><p>
-<font color="#000000">This can return a string even if 
+<font>This can return a string even if 
 	no error occurs. In general you do not need to call this function unless an 
 	ADOdb function returns false on an error. </font></p>
-<p><font color="#000000">Note: If <b>debug</b> is enabled, the SQL error message is always displayed 
+<p><font>Note: If <b>debug</b> is enabled, the SQL error message is always displayed 
 	when the <b>Execute</b> function is called.</font></p>
-<p><font color="#000000"><b>ErrorNo<a name="errorno"></a>()</b></font></p>
-<p><font color="#000000">Returns the last error number. The error number is reset after every call to Execute(). 
+<p><font><b>ErrorNo<a name="errorno"></a>()</b></font></p>
+<p><font>Returns the last error number. The error number is reset after every call to Execute(). 
 If 0 is returned, no error occurred.
 </font></p><p>
-<font color="#000000">Note that old versions of PHP (pre 4.0.6) do 
+<font>Note that old versions of PHP (pre 4.0.6) do 
 	not support error number for ODBC. In general you do not need to call this 
 	function unless an ADOdb function returns false on an error.</font></p>
 
-<p><font color="#000000"><b>SetFetchMode<a name="setfetchmode"></a>($mode)</b></font></p>
-<p><font color="#000000">Sets the current fetch mode for the connection and stores 
+<p><font><b>SetFetchMode<a name="setfetchmode"></a>($mode)</b></font></p>
+<p><font>Sets the current fetch mode for the connection and stores 
 	it in $db-&gt;fetchMode. Legal modes are ADODB_FETCH_ASSOC and ADODB_FETCH_NUM. 
 	For more info, see <a href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a>.</font></p>
-<p><font color="#000000">Returns the previous fetch mode, which could be false 
+<p><font>Returns the previous fetch mode, which could be false 
 	if SetFetchMode( ) has not been called before.</font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><b>CreateSequence<a name="createseq"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
-<p><font color="#000000">Create a sequence. The next time GenID( ) is called, the value returned will 
+<font> 
+</font><p><font><b>CreateSequence<a name="createseq"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
+<p><font>Create a sequence. The next time GenID( ) is called, the value returned will 
 	be $startID. Added in 2.60. 
-</font></p><p><font color="#000000"><b>DropSequenceD<a name="dropseq"></a>($seqName = 'adodbseq')</b></font></p>
-<p><font color="#000000">Delete a sequence. Added in 2.60. 
-</font></p><p><font color="#000000"><b>GenID<a name="genid"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
-<p><font color="#000000">Generate a sequence number . Works for interbase, 
+</font></p><p><font><b>DropSequence<a name="dropseq"></a>($seqName = 'adodbseq')</b></font></p>
+<p><font>Delete a sequence. Added in 2.60. 
+</font></p><p><font><b>GenID<a name="genid"></a>($seqName = 'adodbseq',$startID=1)</b></font></p>
+<p><font>Generate a sequence number . Works for interbase, 
 	mysql, postgresql, oci8, oci8po, mssql, ODBC based (access,vfp,db2,etc) drivers 
 	currently. Uses $seqName as the name of the sequence. GenID() will automatically 
 	create the sequence for you if it does not exist (provided the userid has 
 	permission to do so). Otherwise you will have to create the sequence yourself. 
-</font></p><p><font color="#000000"> If your database driver emulates sequences, the name of the table is the sequence 
+</font></p><p><font> If your database driver emulates sequences, the name of the table is the sequence 
 	name. The table has one column, "id" which should be of type integer, or if 
 	you need something larger - numeric(16). 
-</font></p><p><font color="#000000"> For ODBC and databases that do not support sequences natively (eg mssql, mysql), 
+</font></p><p><font> For ODBC and databases that do not support sequences natively (eg mssql, mysql), 
 	we create a table for each sequence. If the sequence has not been defined 
 	earlier, it is created with the starting value set in $startID.</font></p>
-<p><font color="#000000">Note that the mssql driver's GenID() before 1.90 used to generate 16 byte GUID's.</font></p>
-<p><font color="#000000"><b>UpdateBlob<a name="updateblob"></a>($table,$column,$val,$where)</b></font></p>
-<font color="#000000">Allows you to store a blob (in $val) into $table into $column in a row at $where. 
-</font><p><font color="#000000"> Usage: 
-</font></p><p><font color="#000000"> 
-</font></p><pre><font color="#000000">	# for oracle<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, empty_blob())');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br></font></pre>
-<p><font color="#000000"> Returns true if succesful, false otherwise. Supported by MySQL, PostgreSQL, 
+<p><font>Note that the mssql driver's GenID() before 1.90 used to generate 16 byte GUID's.</font></p>
+<p><font><b>UpdateBlob<a name="updateblob"></a>($table,$column,$val,$where)</b></font></p>
+<font>Allows you to store a blob (in $val) into $table into $column in a row at $where. 
+</font><p><font> Usage: 
+</font></p><p><font> 
+</font></p><pre><font>	# for oracle<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, empty_blob())');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('blobtable','blobcol',$blobvalue,'id=1');<br></font></pre>
+<p><font> Returns true if succesful, false otherwise. Supported by MySQL, PostgreSQL, 
 	Oci8, Oci8po and Interbase drivers. Other drivers might work, depending on 
 	the state of development.</font></p>
-<p><font color="#000000">Note that when an Interbase blob is retrieved using SELECT, it still needs 
+<p><font>Note that when an Interbase blob is retrieved using SELECT, it still needs 
 	to be decoded using $connection-&gt;DecodeBlob($blob); to derive the original 
 	value in versions of PHP before 4.1.0. 
-</font></p><p><font color="#000000">For PostgreSQL, you can store your blob using blob oid's or as a bytea field. 
+</font></p><p><font>For PostgreSQL, you can store your blob using blob oid's or as a bytea field. 
 	You can use bytea fields but not blob oid's currently with UpdateBlob( ). 
 	Conversely UpdateBlobFile( ) supports oid's, but not bytea data.<br>
 	<br>
 	If you do not pass in an oid, then UpdateBlob() assumes that you are storing 
 	in bytea fields.
-</font></p><p><font color="#000000"><b>UpdateClob<a name="updateclob"></a>($table,$column,$val,$where)</b></font></p>
-<font color="#000000">Allows you to store a clob (in $val) into $table into $column in a row at $where. 
+	<p>If you do not have any blob fields, you can improve you can improve general SQL query performance by disabling blob handling with $connection->disableBlobs = true.
+</font></p><p><font><b>UpdateClob<a name="updateclob"></a>($table,$column,$val,$where)</b></font></p>
+<font>Allows you to store a clob (in $val) into $table into $column in a row at $where. 
 Similar to UpdateBlob (see above), but for Character Large OBjects. 
-</font><p><font color="#000000"> Usage:
-</font></p><pre><font color="#000000">	# for oracle<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, empty_clob())');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br></font></pre>
-<p><font color="#000000"><b>UpdateBlobFile<a name="updateblobfile"></a>($table,$column,$path,$where,$blobtype='BLOB')</b></font></p>
-<p><font color="#000000">Similar to UpdateBlob, except that we pass in a file path to where the blob 
+</font><p><font> Usage:
+</font></p><pre><font>	# for oracle<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, empty_clob())');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br>	<br>	# non oracle databases<br>	$conn-&gt;Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)');<br>	$conn-&gt;UpdateBlob('clobtable','clobcol',$clobvalue,'id=1');<br></font></pre>
+<p><font><b>UpdateBlobFile<a name="updateblobfile"></a>($table,$column,$path,$where,$blobtype='BLOB')</b></font></p>
+<p><font>Similar to UpdateBlob, except that we pass in a file path to where the blob 
 	resides.
-</font></p><p><font color="#000000">For PostgreSQL, if you are using blob oid's, use this interface. This interface 
+</font></p><p><font>For PostgreSQL, if you are using blob oid's, use this interface. This interface 
 	does not support bytea fields.
-</font></p><p><font color="#000000">Returns true if successful, false otherwise. 
-</font></p><p><font color="#000000"><b>BlobEncode<a name="blobencode" id="blobencode"></a>($blob)</b> 
-</font></p><p><font color="#000000">Some databases require blob's to be encoded manually before upload. Note if 
+</font></p><p><font>Returns true if successful, false otherwise. 
+</font></p><p><font><b>BlobEncode<a name="blobencode" id="blobencode"></a>($blob)</b> 
+</font></p><p><font>Some databases require blob's to be encoded manually before upload. Note if 
 	you use UpdateBlob( ) or UpdateBlobFile( ) the conversion is done automatically 
 	for you and you do not have to call this function. For PostgreSQL, currently, 
 	BlobEncode() can only be used for bytea fields.
-</font></p><p><font color="#000000">Returns the encoded blob value.
-</font></p><p><font color="#000000">Note that there is a connection property called <em>blobEncodeType</em> which 
+</font></p><p><font>Returns the encoded blob value.
+</font></p><p><font>Note that there is a connection property called <em>blobEncodeType</em> which 
 	has 3 legal values: 
-</font></p><p><font color="#000000">false - no need to perform encoding or decoding.<br>
+</font></p><p><font>false - no need to perform encoding or decoding.<br>
 	'I' - blob encoding required, and returned encoded blob is a numeric value 
 	(no need to quote).<br>
 	'C' - blob encoding required, and returned encoded blob is a character value 
 	(requires quoting).
-</font></p><p><font color="#000000">This is purely for documentation purposes, so that programs that accept multiple 
+</font></p><p><font>This is purely for documentation purposes, so that programs that accept multiple 
 	database drivers know what is the right thing to do when processing blobs.
-</font></p><p><font color="#000000"><strong>BlobDecode<a name="blobdecode"></a>($blob, $maxblobsize = false)</strong> 
-</font></p><p><font color="#000000">Some databases require blob's to be decoded manually after doing a select statement. 
+</font></p><p><font><strong>BlobDecode<a name="blobdecode"></a>($blob, $maxblobsize = false)</strong> 
+</font></p><p><font>Some databases require blob's to be decoded manually after doing a select statement. 
 	If the database does not require decoding, then this function will return 
 	the blob unchanged. Currently BlobDecode is only required for one database, 
 	PostgreSQL, and only if you are using blob oid's (if you are using bytea fields, 
-	we auto-decode for you).</font> The default maxblobsize is set in $connection->maxblobsize, which 
-	is set to 256K in adodb 4.54. <p>
-	In ADOdb 4.54 and later, the blob is the return value. In earlier versions, the blob data is sent to stdout.</p><font color="#000000">
-</font></p><pre><font color="#000000">$rs = $db-&gt;Execute("select bloboid from postgres_table where id=$key");<br>$blob = $db-&gt;BlobDecode( reset($rs-&gt;fields) );</font></pre>
-<p><font color="#000000"><b>Replace<a name="replace"></a>($table, $arrFields, $keyCols,$autoQuote=false)</b></font></p>
-<p><font color="#000000">Try to update a record, and if the record is not found, an insert statement 
+	we auto-decode for you).</font> The default maxblobsize is set in $connection-&gt;maxblobsize, which 
+	is set to 256K in adodb 4.54. </p><p>
+	In ADOdb 4.54 and later, the blob is the return value. In earlier versions, the blob data is sent to stdout.</p><font>
+</font><p></p><pre><font>$rs = $db-&gt;Execute("select bloboid from postgres_table where id=$key");<br>$blob = $db-&gt;BlobDecode( reset($rs-&gt;fields) );</font></pre>
+<p><font><b>Replace<a name="replace"></a>($table, $arrFields, $keyCols,$autoQuote=false)</b></font></p>
+<p><font>Try to update a record, and if the record is not found, an insert statement 
 	is generated and executed. Returns 0 on failure, 1 if update statement worked, 
 	2 if no record was found and the insert was executed successfully. This differs 
 	from MySQL's replace which deletes the record and inserts a new record. This 
 	also means you cannot update the primary key. The only exception to this is 
 	Interbase and its derivitives, which uses delete and insert because of some 
 	Interbase API limitations. 
-</font></p><p><font color="#000000">The parameters are $table which is the table name, the $keyCols which is an 
-	associative array where the keys are the field names, and keyCols is the name 
+</font></p><p><font>The parameters are $table which is the table name, the $arrFields which is an 
+	associative array where the keys are the field names, and $keyCols is the name 
 	of the primary key, or an array of field names if it is a compound key. If 
 	$autoQuote is set to true, then Replace() will quote all values that are non-numeric; 
 	auto-quoting will not quote nulls. Note that auto-quoting will not work if 
 	you use SQL functions or operators. 
-</font></p><p><font color="#000000">Examples: 
-</font></p><pre><font color="#000000"># single field primary key<br>$ret = $db-&gt;Replace('atable', <br>	array('id'=&gt;1000,'firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid'),<br>	'id',$autoquote = true);	<br># generates UPDATE atable SET firstname='Harun',lastname='Al-Rashid' WHERE id=1000<br># or INSERT INTO atable (id,firstname,lastname) VALUES (1000,'Harun','Al-Rashid')<br><br># compound key<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid', 'age' =&gt; 33, 'birthday' =&gt; 'null'),<br>	array('lastname','firstname'),<br>	$autoquote = true);<br><br># no auto-quoting<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;"'Harun'",'lastname'=&gt;"'Al-Rashid'", 'age' =&gt; 'null'),<br>	array('lastname','firstname'));	<br></font></pre>
-<p><font color="#000000"><b>GetUpdateSQL<a name="getupdatesql"></a>(&amp;$rs, $arrFields, $forceUpdate=false,$magicq=false, $force=null)</b></font></p>
-<p><font color="#000000">Generate SQL to update a table given a recordset $rs, and the modified fields 
+</font></p><p><font>Examples: 
+</font></p><pre><font># single field primary key<br>$ret = $db-&gt;Replace('atable', <br>	array('id'=&gt;1000,'firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid'),<br>	'id',$autoquote = true);	<br># generates UPDATE atable SET firstname='Harun',lastname='Al-Rashid' WHERE id=1000<br># or INSERT INTO atable (id,firstname,lastname) VALUES (1000,'Harun','Al-Rashid')<br><br># compound key<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;'Harun','lastname'=&gt;'Al-Rashid', 'age' =&gt; 33, 'birthday' =&gt; 'null'),<br>	array('lastname','firstname'),<br>	$autoquote = true);<br><br># no auto-quoting<br>$ret = $db-&gt;Replace('atable2', <br>	array('firstname'=&gt;"'Harun'",'lastname'=&gt;"'Al-Rashid'", 'age' =&gt; 'null'),<br>	array('lastname','firstname'));	<br></font></pre>
+<p><font><b>AutoExecute<a name="autoexecute"></a>($table, $arrFields, $mode, $where=false, $forceUpdate=true,$magicq=false)</b></font></p>
+<p>Since ADOdb 4.56, you can automatically generate and execute INSERTs and UPDATEs on a given table with this
+function, which is a wrapper for GetInsertSQL() and GetUpdateSQL().
+<p>AutoExecute() inserts or updates $table given an array of $arrFields, where the keys are the field names and the array values are the 
+field values to store. Note that there is some overhead because the table is first queried to extract key information 
+before the SQL is generated. We generate an INSERT or UPDATE based on $mode (see below).
+<p>
+Legal values for $mode are 
+<ul>
+<li>'INSERT' or 1 or DB_AUTOQUERY_INSERT
+<li>'UPDATE' or 2 or DB_AUTOQUERY_UPDATE
+</ul>
+<p>You have to define the constants DB_AUTOQUERY_UPDATE and DB_AUTOQUERY_INSERT yourself or include adodb-pear.inc.php.
+<p>The $where clause is required if $mode == 'UPDATE'. If $forceUpdate=false then we will query the 
+database first and check if the field value returned by the query matches the current field value; only if they differ do we update that field.
+<p>Returns true on success, false on error.
+<p>An example of its use is:
+<pre>
+$record["firstName"] = "Carol";
+$record["lasTname"] = "Smith"; 
+$conn->AutoExecute($table,$record,'INSERT');
+# executes <i>"INSERT INTO $table (firstName,lasTname) values ('Carol',Smith')"</i>;
+
+$record["firstName"] = "Carol";
+$record["lasTname"] = "Jones"; 
+$conn->AutoExecute($table,$record,'UPDATE', "lastname like 'Sm%'");
+# executes <i>"UPDATE $table SET firstName='Carol',lasTname='Jones' WHERE lastname like 'Sm%'"</i>;
+</pre>
+<p>Note: One of the strengths of ADOdb's AutoExecute() is that only valid field names for $table are updated. If $arrFields
+contains keys that are invalid field names for $table, they are ignored. There is some overhead in doing this as we have to 
+query the database to get the field names, but given that you are not directly coding the SQL yourself, you probably aren't interested in
+speed at all, but convenience.
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
+<p><font><b>GetUpdateSQL<a name="getupdatesql"></a>(&amp;$rs, $arrFields, $forceUpdate=false,$magicq=false, $force=null)</b></font></p>
+<p><font>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 
 	is true, then we also generate the SQL even if $arrFields is identical to 
 	$rs-&gt;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.</font></p>
-<font color="#000000">	</font><p><font color="#000000">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>
+<font>	</font><p><font>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.
-</font></p><p><font color="#000000"><b>GetInsertSQL<a name="getinsertsql"></a>(&amp;$rs, $arrFields,$magicq=false,$force=false)</b></font></p>
-<p><font color="#000000">Generate SQL to insert into a table given a recordset $rs. Requires the query 
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
+</font></p><p><font><b>GetInsertSQL<a name="getinsertsql"></a>(&amp;$rs, $arrFields,$magicq=false,$force_type=false)</b></font></p>
+<p><font>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.</font></p>
 <p>
-<font color="#000000">  Since 2.42, you can pass a  table name instead of a recordset into 
+<font>  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.
-</font></p><p><font color="#000000">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>
+</font></p><p><font>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.
-</font></p><p><font color="#000000"><b>PageExecute<a name="pageexecute"></a>($sql, $nrows, $page, $inputarr=false)</b> 
-</font></p><p><font color="#000000">Used for pagination of recordset. $page is 1-based. See <a href="#ex8">Example 
+<p>Since 4.62, the table name to be used can be overridden by setting $rs->tableName before AutoExecute(), GetInsertSQL() or GetUpdateSQL() is called.
+</font></p><p><font><b>PageExecute<a name="pageexecute"></a>($sql, $nrows, $page, $inputarr=false)</b> 
+</font></p><p><font>Used for pagination of recordset. $page is 1-based. See <a href="#ex8">Example 
   8</a>.</font></p>
  
-<p><font color="#000000"><b>CachePageExecute<a name="cachepageexecute"></a>($secs2cache, 
+<p><font><b>CachePageExecute<a name="cachepageexecute"></a>($secs2cache, 
   $sql, $nrows, $page, $inputarr=false)</b> </font></p>
-<p><font color="#000000">Used for pagination of recordset. $page is 1-based. See 
+<p><font>Used for pagination of recordset. $page is 1-based. See 
   <a href="#ex8">Example 8</a>. Caching version of PageExecute.</font></p>
-<font color="#000000"> 
+<font> 
 </font><p></p>
-<p><font color="#000000"><b>Close<a name="close"></a>( )</b></font></p>
-<p><font color="#000000">Close the database connection. PHP4 proudly states that we no longer have to 
+<p><font><b>Close<a name="close"></a>( )</b></font></p>
+<p><font>Close the database connection. PHP4 proudly states that we no longer have to 
   clean up at the end of the connection because the reference counting mechanism 
   of PHP4 will automatically clean up for us.</font></p>
-<font color="#000000">  </font><p><font color="#000000"><b>StartTrans<a name="starttrans"></a>( )</b></font></p>
-<font color="#000000">  </font><p><font color="#000000">Start a monitored transaction. As SQL statements are executed, ADOdb will monitor
+<font>  </font><p><font><b>StartTrans<a name="starttrans"></a>( )</b></font></p>
+<font>  </font><p><font>Start a monitored transaction. As SQL statements are executed, ADOdb will monitor
   for SQL errors, and if any are detected, when CompleteTrans() is called, we auto-rollback.
   </font></p><p>
-<font color="#000000">  </font></p><p><font color="#000000"> To understand why StartTrans() is superior to BeginTrans(), 
+<font>  </font></p><p><font> To understand why StartTrans() is superior to BeginTrans(), 
   let us examine a few ways of using BeginTrans().
   The following is the wrong way to use transactions: 
-</font></p><pre><font color="#000000">$DB-&gt;BeginTrans();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans();<br></font></pre>
-<p><font color="#000000">because you perform no error checking. It is possible to update table1 and 
+</font></p><pre><font>$DB-&gt;BeginTrans();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans();<br></font></pre>
+<p><font>because you perform no error checking. It is possible to update table1 and 
   for the update on table2 to fail. Here is a better way: 
-</font></p><pre><font color="#000000">$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>if ($ok) $DB-&gt;CommitTrans();<br>else $DB-&gt;RollbackTrans();<br></font></pre>
-<p><font color="#000000">Another way is (since ADOdb 2.0): 
-</font></p><pre><font color="#000000">$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans($ok);<br></font></pre>
-<p><font color="#000000"> Now it is a headache monitoring $ok all over the place. StartTrans() is an
+</font></p><pre><font>$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>if ($ok) $DB-&gt;CommitTrans();<br>else $DB-&gt;RollbackTrans();<br></font></pre>
+<p><font>Another way is (since ADOdb 2.0): 
+</font></p><pre><font>$DB-&gt;BeginTrans();<br>$ok = $DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>if ($ok) $ok = $DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CommitTrans($ok);<br></font></pre>
+<p><font> Now it is a headache monitoring $ok all over the place. StartTrans() is an
 improvement because it monitors all SQL errors for you. This is particularly
 useful if you are calling black-box functions in which SQL queries might be executed.
  Also all BeginTrans, CommitTrans and RollbackTrans calls inside a StartTrans block 
   will be disabled, so even if the black box function does a commit, it will be ignored.
-</font></p><pre><font color="#000000">$DB-&gt;StartTrans();<br>CallBlackBox();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CompleteTrans($ok);<br></font></pre>
-<p><font color="#000000">Note that a StartTrans blocks are nestable, the inner blocks are ignored.
- </font></p><p><font color="#000000"><b>CompleteTrans<a name="completetrans"></a>($autoComplete=true)</b></font></p>
-<font color="#000000">  </font><p><font color="#000000">Complete a transaction called with StartTrans(). This function monitors
+</font></p><pre><font>$DB-&gt;StartTrans();<br>CallBlackBox();<br>$DB-&gt;Execute("update table1 set val=$val1 where id=$id");<br>$DB-&gt;Execute("update table2 set val=$val2 where id=$id");<br>$DB-&gt;CompleteTrans($ok);<br></font></pre>
+<p><font>Note that a StartTrans blocks are nestable, the inner blocks are ignored.
+ </font></p><p><font><b>CompleteTrans<a name="completetrans"></a>($autoComplete=true)</b></font></p>
+<font>  </font><p><font>Complete a transaction called with StartTrans(). This function monitors
   for SQL errors, and will commit if no errors have occured, otherwise it will rollback. 
   Returns true on commit, false on rollback. If the parameter $autoComplete is true
   monitor sql errors and commit and rollback as appropriate. Set $autoComplete to false 
   to force rollback even if no SQL error detected.
-  </font></p><p><font color="#000000"><b>FailTrans<a name="failtrans"></a>( )</b></font></p>
-<font color="#000000">  </font><p><font color="#000000">Fail a transaction started with StartTrans(). The rollback will only occur when
+  </font></p><p><font><b>FailTrans<a name="failtrans"></a>( )</b></font></p>
+<font>  </font><p><font>Fail a transaction started with StartTrans(). The rollback will only occur when
   CompleteTrans() is called.
-    </font></p><p><font color="#000000"><b>HasFailedTrans<a name="hasfailedtrans"></a>( )</b></font></p>
-<font color="#000000">	</font><p><font color="#000000">Check whether smart transaction has failed, 
+    </font></p><p><font><b>HasFailedTrans<a name="hasfailedtrans"></a>( )</b></font></p>
+<font>	</font><p><font>Check whether smart transaction has failed, 
 	eg. returns true if there was an error in SQL execution or FailTrans() was called.
 	If not within smart transaction, returns false.
-</font></p><p><font color="#000000"><b>BeginTrans<a name="begintrans"></a>( )</b></font></p>
-<p><font color="#000000">Begin a transaction. Turns off autoCommit. Returns true if successful. Some 
+</font></p><p><font><b>BeginTrans<a name="begintrans"></a>( )</b></font></p>
+<p><font>Begin a transaction. Turns off autoCommit. Returns true if successful. Some 
   databases will always return false if transaction support is not available. 
    Any open transactions will be rolled back when the connection is closed. Among the
    databases that support transactions are Oracle, PostgreSQL, Interbase, MSSQL, certain
     versions of MySQL, DB2, Informix, Sybase, etc.</font></p>
-<font color="#000000"> </font><p><font color="#000000">Note that <a href="#starttrans">StartTrans()</a> and CompleteTrans() is a superior method of 
+<font> </font><p><font>Note that <a href="#starttrans">StartTrans()</a> and CompleteTrans() is a superior method of 
  handling transactions, available since ADOdb 3.40. For a explanation, see the <a href="#starttrans">StartTrans()</a> documentation.
 
-</font></p><p><font color="#000000">You can also use the ADOdb <a href="#errorhandling">error handler</a> to die 
+</font></p><p><font>You can also use the ADOdb <a href="#errorhandling">error handler</a> to die 
   and rollback your transactions for you transparently. Some buggy database extensions 
   are known to commit all outstanding tranasactions, so you might want to explicitly 
   do a $DB-&gt;RollbackTrans() in your error handler for safety. 
- </font></p><h4><font color="#000000">Detecting Transactions</font></h4>
-<font color="#000000"> </font><p><font color="#000000">Since ADOdb 2.50, you are able to detect when you are inside a transaction. Check
+ </font></p><h4><font>Detecting Transactions</font></h4>
+<font> </font><p><font>Since ADOdb 2.50, you are able to detect when you are inside a transaction. Check
  that $connection-&gt;transCnt &gt; 0. This variable is incremented whenever BeginTrans() is called,
  and decremented whenever RollbackTrans() or CommitTrans() is called.
-</font></p><p><font color="#000000"><b>CommitTrans<a name="committrans"></a>($ok=true)</b></font></p>
-<p><font color="#000000">End a transaction successfully. Returns true if successful. If the database 
+</font></p><p><font><b>CommitTrans<a name="committrans"></a>($ok=true)</b></font></p>
+<p><font>End a transaction successfully. Returns true if successful. If the database 
   does not support transactions, will return true also as data is always committed. 
 </font></p>
-<p><font color="#000000">If you pass the parameter $ok=false, the data is rolled back. See example in 
+<p><font>If you pass the parameter $ok=false, the data is rolled back. See example in 
   BeginTrans().</font></p>
-<p><font color="#000000"><b>RollbackTrans<a name="rollbacktrans"></a>( )</b></font></p>
-<p><font color="#000000">End a transaction, rollback all changes. Returns true if successful. If the 
+<p><font><b>RollbackTrans<a name="rollbacktrans"></a>( )</b></font></p>
+<p><font>End a transaction, rollback all changes. Returns true if successful. If the 
   database does not support transactions, will return false as data is never rollbacked. 
 </font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><b>GetAssoc<a name="getassoc1"></a>($sql,$inputarr=false,$force_array=false,$first2cols=false)</b></font></p>
-<p><font color="#000000">Returns an associative array for the given query $sql with optional bind parameters 
+<font> 
+</font><p><font><b>GetAssoc<a name="getassoc1"></a>($sql,$inputarr=false,$force_array=false,$first2cols=false)</b></font></p>
+<p><font>Returns an associative array for the given query $sql with optional bind parameters 
   in $inputarr. If the number of columns returned is greater to two, a 2-dimensional 
   array is returned, with the first column of the recordset becomes the keys 
   to the rest of the rows. If the columns is equal to two, a 1-dimensional array 
   is created, where the the keys directly map to the values (unless $force_array 
   is set to true, when an array is created for each value).
-</font></p><p><font color="#000000"> <font color="#000000">Examples:<a name="getassocex"></a></font></font></p>
+</font></p><p><font> Examples:<a name="getassocex"></a></font></p>
 
-<p><font color="#000000">We have the following data in a recordset:</font></p>
-<p><font color="#000000">row1: Apple, Fruit, Edible<br>
+<p><font>We have the following data in a recordset:</font></p>
+<p><font>row1: Apple, Fruit, Edible<br>
   row2: Cactus, Plant, Inedible<br>
   row3: Rose, Flower, Edible</font></p>
-<p><font color="#000000">GetAssoc will generate the following 2-dimensional associative 
+<p><font>GetAssoc will generate the following 2-dimensional associative 
   array:</font></p>
-<p><font color="#000000">Apple =&gt; array[Fruit, Edible]<br>
+<p><font>Apple =&gt; array[Fruit, Edible]<br>
   Cactus =&gt; array[Plant, Inedible]<br>
   Rose =&gt; array[Flower,Edible]</font></p>
-<p><font color="#000000">If the dataset is:</font></p>
-<p><font color="#000000"><font color="#000000"><font color="#000000">row1: Apple, 
-  Fruit<br>
-  row2: Cactus, Plant<br>
-  row3: Rose, Flower</font> </font></font></p>
-<p><font color="#000000"><font color="#000000">GetAssoc will generate the following 
-  1-dimensional associative array (with $force_array==false):</font></font></p>
-<p><font color="#000000">Apple =&gt; Fruit</font><br>
+<p><font>If the dataset is:</font></p>
+<p><font>row1: Apple, Fruit<br>
+row2: Cactus, Plant<br>
+row3: Rose, Flower </font></p>
+<p><font>GetAssoc will generate the following 1-dimensional associative
+  array (with $force_array==false):</font></p>
+<p><font>Apple =&gt; Fruit</font><br>
   Cactus=&gt;Plant<br>
-  Rose=&gt;Flower <font color="#000000"><font color="#000000"> </font></font><font color="#000000"><font color="#000000"></font></font></p>
-<p><font color="#000000">The function returns:</font></p>
-<p><font color="#000000">The associative array, or false if an error occurs.</font></p>
-<font color="#000000">
+  Rose=&gt;Flower </p>
+<p><font>The function returns:</font></p>
+<p><font>The associative array, or false if an error occurs.</font></p>
+<font>
 <p><b>CacheGetAssoc<a name="cachegetassoc"></a>([$secs2cache,] $sql,$inputarr=false,$force_array=false,$first2cols=false)</b></p>
-</font><font color="#000000"> 
-</font><p><font color="#000000">Caching version of <a href="#getassoc1">GetAssoc</a> function above.
-</font></p><p><font color="#000000"><b>GetOne<a name="getone"></a>($sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Executes the SQL and returns the first field of the first row. The recordset 
+</font>
+<p><font>Caching version of <a href="#getassoc1">GetAssoc</a> function above.
+</font></p><p><font><b>GetOne<a name="getone"></a>($sql,$inputarr=false)</b></font></p>
+<p><font>Executes the SQL and returns the first field of the first row. The recordset 
   and remaining rows are discarded for you automatically. If an error occur, false 
   is returned.</font></p>
-<p><font color="#000000"><b>GetRow<a name="getrow"></a>($sql,$inputarr=false)</b></font></p>
-<p><font color="#000000">Executes the SQL and returns the first row as an array. The recordset and remaining 
+<p><font><b>GetRow<a name="getrow"></a>($sql,$inputarr=false)</b></font></p>
+<p><font>Executes the SQL and returns the first row as an array. The recordset and remaining 
   rows are discarded for you automatically. If an error occurs, false is returned.</font></p>
-<p><font color="#000000"><b>GetAll<a name="getall"></a>($sql)</b></font></p>
+<p><font><b>GetAll<a name="getall"></a>($sql)</b></font></p>
 
-<p><font color="#000000">Executes the SQL and returns the all the rows as a 2-dimensional 
+<p><font>Executes the SQL and returns the all the rows as a 2-dimensional 
   array. The recordset is discarded for you automatically. If an error occurs, 
   false is returned.</font></p>
  <p><b>GetCol<a name="getcol"></a>($sql,$inputarr=false,$trim=false)</b></p>
 
-<p><font color="#000000">Executes the SQL and returns all elements of the first column as a 
+<p><font>Executes the SQL and returns all elements of the first column as a 
 1-dimensional array. The recordset is discarded for you automatically. If an error occurs, 
   false is returned.</font></p>
-<p><font color="#000000"><b>CacheGetOne<a name="cachegetone"></a>([$secs2cache,] 
+<p><font><b>CacheGetOne<a name="cachegetone"></a>([$secs2cache,] 
   $sql,$inputarr=false), CacheGetRow<a name="cachegetrow"></a>([$secs2cache,] $sql,$inputarr=false), CacheGetAll<a name="cachegetall"></a>([$secs2cache,] 
   $sql,$inputarr=false), CacheGetCol<a name="cachegetcol"></a>([$secs2cache,] 
   $sql,$inputarr=false,$trim=false)</b></font></p>
-<font color="#000000"> 
-<p>Similar to above Get* functions, except that the recordset is serialized and 
+<font> 
+</font><p><font>Similar to above Get* functions, except that the recordset is serialized and 
   cached in the $ADODB_CACHE_DIR directory for $secs2cache seconds. Good for speeding 
   up queries on rarely changing data. Note that the $secs2cache parameter is optional. 
   If omitted, we use the value in $connection-&gt;cacheSecs (default is 3600 seconds, 
-  or 1 hour).</p>
-<p><b>Prepare<a name="prepare"></a>($sql )</b></p>
-</font> 
-<p><font color="#000000">Prepares (compiles) an SQL query for repeated execution. Bind parameters
+  or 1 hour).</font></p>
+<p><font><b>Prepare<a name="prepare"></a>($sql )</b></font></p>
+ 
+<p><font>Prepares (compiles) an SQL query for repeated execution. Bind parameters
 are denoted by ?, except for the oci8 driver, which uses the traditional Oracle :varname
 convention. 
   </font></p>
-<p><font color="#000000">Returns an array containing the original sql statement 
+<p><font>Returns an array containing the original sql statement 
   in the first array element; the remaining elements of the array are driver dependent. 
   If there is an error, or we are emulating Prepare( ), we return the original 
   $sql string. This is because all error-handling has been centralized in Execute( 
   ).</font></p>
-<p><font color="#000000">Prepare( ) cannot be used with functions that use SQL 
+<p><font>Prepare( ) cannot be used with functions that use SQL 
   query rewriting techniques, e.g. PageExecute( ) and SelectLimit( ).</font></p>
 <p>Example:</p>
-<pre><font color="#000000">$stmt = $DB-&gt;Prepare('insert into table (col1,col2) values (?,?)');<br>for ($i=0; $i &lt; $max; $i++)<br></font>	$DB-&gt;<font color="#000000">Execute($stmt,array((string) rand(), $i));<br></font></pre>
-<font color="#000000"> 
-</font><p><font color="#000000">Also see InParameter(), OutParameter() and PrepareSP() below. Only supported internally by interbase, 
+<pre><font>$stmt = $DB-&gt;Prepare('insert into table (col1,col2) values (?,?)');<br>for ($i=0; $i &lt; $max; $i++)<br></font>	$DB-&gt;<font>Execute($stmt,array((string) rand(), $i));<br></font></pre>
+<font> 
+</font><p><font>Also see InParameter(), OutParameter() and PrepareSP() below. Only supported internally by interbase, 
   oci8 and selected ODBC-based drivers, otherwise it is emulated. There is no 
   performance advantage to using Prepare() with emulation. 
-</font></p><p><font color="#000000"> Important: Due to limitations or bugs in PHP, if you are getting errors when 
+</font></p><p><font> Important: Due to limitations or bugs in PHP, if you are getting errors when 
   you using prepared queries, try setting $ADODB_COUNTRECS = false before preparing. 
   This behaviour has been observed with ODBC. 
-</font></p><p><font color="#000000"><b>IfNull<a name="ifnull"></a>($field, $nullReplacementValue)</b></font></p>
-<p><font color="#000000">Portable IFNULL function (NVL in Oracle). Returns a string that represents 
+</font></p><p><font><b>IfNull<a name="ifnull"></a>($field, $nullReplacementValue)</b></font></p>
+<p><font>Portable IFNULL function (NVL in Oracle). Returns a string that represents 
   the function that checks whether a $field is null for the given database, and 
   if null, change the value returned to $nullReplacementValue. Eg.</font></p>
-<pre><font color="#000000">$sql = <font color="#993300">'SELECT '</font>.$db-&gt;IfNull('name', <font color="#993300">"'- unknown -'"</font>).<font color="#993300"> ' FROM table'</font>;</font></pre>
+<pre><font>$sql = <font color="#993300">'SELECT '</font>.$db-&gt;IfNull('name', <font color="#993300">"'- unknown -'"</font>).<font color="#993300"> ' FROM table'</font>;</font></pre>
 
-<p><font color="#000000"><b>length<a name="length"></a></b></font></p>
-<p><font color="#000000">This is not a function, but a property. Some databases have "length" and others "len"
+<p><font><b>length<a name="length"></a></b></font></p>
+<p><font>This is not a function, but a property. Some databases have "length" and others "len"
 as the function to measure the length of a string. To use this property:
-</font></p><pre><font color="#000000">  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;length.<font color="#993300">"(field) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
+</font></p><pre><font>  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;length.<font color="#993300">"(field) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
 
-<p><font color="#000000"><b>random<a name="random"></a></b></font></p>
-<p><font color="#000000">This is not a function, but a property. This is a string that holds the sql to
+<p><font><b>random<a name="random"></a></b></font></p>
+<p><font>This is not a function, but a property. This is a string that holds the sql to
 generate a random number between 0.0 and 1.0 inclusive.
 
-</font></p><p><font color="#000000"><b>substr<a name="substr"></a></b></font></p>
-<p><font color="#000000">This is not a function, but a property. Some databases have "substr" and others "substring"
+</font></p><p><font><b>substr<a name="substr"></a></b></font></p>
+<p><font>This is not a function, but a property. Some databases have "substr" and others "substring"
 as the function to retrieve a sub-string. To use this property:
-</font></p><pre><font color="#000000">  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;substr.<font color="#993300">"(field, $offset, $length) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
-<p><font color="#000000">For all databases, the 1st parameter of <i>substr</i> is the field, the 2nd is the
+</font></p><pre><font>  $sql = <font color="#993300">"SELECT "</font>.$db-&gt;substr.<font color="#993300">"(field, $offset, $length) from table"</font>;<br>  $rs = $db-&gt;Execute($sql);<br></font></pre>
+<p><font>For all databases, the 1st parameter of <i>substr</i> is the field, the 2nd is the
 offset (1-based) to the beginning of the sub-string, and the 3rd is the length of the sub-string.
 
 
-</font></p><p><font color="#000000"><b>Param<a name="param"></a>($name)</b></font></p>
-<p><font color="#000000">Generates a bind placeholder portably. For most databases, the bind placeholder 
+</font></p><p><font><b>Param<a name="param"></a>($name)</b></font></p>
+<p><font>Generates a bind placeholder portably. For most databases, the bind placeholder 
   is "?". However some databases use named bind parameters such as Oracle, eg 
   ":somevar". This allows us to portably define an SQL statement with bind parameters: 
-</font></p><pre><font color="#000000"><font color="#000000">$sql = <font color="#993300">'insert into table (col1,col2) values ('</font>.$DB-&gt;Param('a').<font color="#993300">','</font>.$DB-&gt;Param('b').<font color="#993300">')'</font>;<br><font color="#006600"># generates 'insert into table (col1,col2) values (?,?)'<br># or        'insert into table (col1,col2) values (:a,:b)</font>'<br>$stmt = $DB-&gt;Prepare($sql);<br>$stmt = $DB-&gt;Execute($stmt,array('one','two'));<br></font></font></pre>
-<font color="#000000"><font color="#000000"> 
-</font></font><p></p>
-<p><font color="#000000"><font color="#000000"><b>PrepareSP</b><b><a name="preparesp"></a></b><b>($sql, $cursor=false )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">When calling stored procedures in mssql and oci8 (oracle), and you might want 
-  to directly bind to parameters that return values, or for special LOB handling. 
-  PrepareSP() allows you to do so. 
-</font></font></p><p><font color="#000000"><font color="#000000">Returns the same array or $sql string as Prepare( ) above. If you do not need 
-  to bind to return values, you should use Prepare( ) instead.</font></font></p>
-<p><font color="#000000"><font color="#000000">The 2nd parameter, $cursor is not used except with oci8. Setting it to true will
-force OCINewCursor to be called; this is to support output REF CURSORs.
-</font></font></p><p><font color="#000000"><font color="#000000">For examples of usage of PrepareSP( ), see InParameter( ) below. 
-</font></font></p><p><font color="#000000"><font color="#000000">Note: in the mssql driver, preparing stored procedures requires a special function 
-  call, mssql_init( ), which is called by this function. PrepareSP( ) is available 
-  in all other drivers, and is emulated by calling Prepare( ). </font></font></p>
-<p><font color="#000000"><font color="#000000"><b> InParameter<a name="inparameter"></a>($stmt, $var, $name,
-  $maxLen = 4000, $type = false )</b></font></font></p>
-<font color="#000000"><font color="#000000">Binds a PHP variable as input to a stored procedure variable. The parameter <i>$stmt</i>
- is the value returned by PrepareSP(), <i>$var</i> is the PHP variable you want to bind, $name
- is the name of the stored procedure variable. Optional is <i>$maxLen</i>, the maximum length of the
- data to bind, and $type which is database dependant. 
- Consult <a href="http://php.net/mssql_bind">mssql_bind</a> and <a href="http://php.net/ocibindbyname">ocibindbyname</a> docs
-  at php.net for more info on legal values for $type. 
- </font></font><p>
-<font color="#000000"><font color="#000000">InParameter() is a wrapper function that calls Parameter() with $isOutput=false. 
-The advantage of this function is that it is self-documenting, because
-the $isOutput parameter is no longer needed.  Only for mssql 
-  and oci8 currently.
-  </font></font></p><p><font color="#000000"><font color="#000000">Here is an example using oci8:
-  </font></font></p><pre><font color="#000000"><font color="#000000"><font color="green"># For oracle, Prepare and PrepareSP are identical</font>
+</font></p><pre><font>$sql = <font color="#993300">'insert into table (col1,col2) values ('</font>.$DB-&gt;Param('a').<font color="#993300">','</font>.$DB-&gt;Param('b').<font color="#993300">')'</font>;<br><font color="#006600"># generates 'insert into table (col1,col2) values (?,?)'<br># or        'insert into table (col1,col2) values (:a,:b)</font>'<br>$stmt = $DB-&gt;Prepare($sql);<br>$stmt = $DB-&gt;Execute($stmt,array('one','two'));<br></font></pre>
+<font> </font>
+<p></p>
+<p><font><b>PrepareSP</b><b><a name="preparesp"></a></b><b>($sql,
+$cursor=false )</b></font></p>
+<p><font>When calling stored procedures in mssql and oci8 (oracle),
+    and you might want to directly bind to parameters that return values, or
+for special LOB handling. PrepareSP() allows you to do so. </font></p>
+<p><font>Returns the same array or $sql string as Prepare( )
+    above. If you do not need to bind to return values, you should use Prepare(
+  ) instead.</font></p>
+<p><font>The 2nd parameter, $cursor is not used except with oci8.
+    Setting it to true will force OCINewCursor to be called; this is to support
+output REF CURSORs. </font></p>
+<p><font>For examples of usage of PrepareSP( ), see InParameter(
+) below. </font></p>
+<p><font>Note: in the mssql driver, preparing stored procedures
+    requires a special function call, mssql_init( ), which is called by this
+    function. PrepareSP( ) is available in all other drivers, and is emulated
+  by calling Prepare( ). </font></p>
+<p><font><b> InParameter<a name="inparameter"></a>($stmt, $var,
+  $name, $maxLen = 4000, $type = false )</b></font></p>
+<font>Binds a PHP variable as input to a stored procedure variable.
+The parameter <i>$stmt</i> is the value returned by PrepareSP(), <i>$var</i> is
+the PHP variable you want to bind, $name is the name of the stored procedure
+variable. Optional is <i>$maxLen</i>, the maximum length of the data to bind,
+and $type which is database dependant. Consult <a href="http://php.net/mssql_bind">mssql_bind</a> and <a href="http://php.net/ocibindbyname">ocibindbyname</a> docs
+at php.net for more info on legal values for $type. </font>
+<p>
+<font>InParameter() is a wrapper function that calls Parameter()
+with $isOutput=false. The advantage of this function is that it is self-documenting,
+because the $isOutput parameter is no longer needed. Only for mssql and oci8
+currently. </font></p>
+<p><font>Here is an example using oci8: </font></p>
+<pre><font><font color="green"># For oracle, Prepare and PrepareSP are identical</font>
 $stmt = $db-&gt;PrepareSP(
-	<font color="#993300">"declare RETVAL integer; <br>	begin<br>	:RETVAL := </font><font color="#993300">SP_RUNSOMETHING</font><font color="#993300">(:myid,:group);<br>	end;"</font>);<br>$db-&gt;InParameter($stmt,$id,'myid');<br>$db-&gt;InParameter($stmt,$group,'group',64);<br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt);<br></font></font></pre>
-<p><font color="#000000"><font color="#000000"> The same example using mssql:</font></font></p>
-<font color="#000000"> 
-</font><pre><font color="#000000"><font color="#000000"><font color="green"># @RETVAL = SP_RUNSOMETHING @myid, at group</font>
+	<font color="#993300">"declare RETVAL integer; <br>	begin<br>	:RETVAL := </font><font color="#993300">SP_RUNSOMETHING</font><font color="#993300">(:myid,:group);<br>	end;"</font>);<br>$db-&gt;InParameter($stmt,$id,'myid');<br>$db-&gt;InParameter($stmt,$group,'group',64);<br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt);<br></font></pre>
+<p><font> The same example using mssql:</font></p>
+<font> 
+</font><pre><font><font color="green"># @RETVAL = SP_RUNSOMETHING @myid, at group</font>
 $stmt = $db-&gt;PrepareSP(<font color="#993333">'<font color="#993300">SP_RUNSOMETHING</font>'</font>); <br><font color="green"># note that the parameter name does not have @ in front!</font>
 $db-&gt;InParameter($stmt,$id,'myid');
 $db-&gt;InParameter($stmt,$group,'group',64);
-<font color="green"># return value in mssql - RETVAL is hard-coded name</font> <br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt); </font></font></pre>
+<font color="green"># return value in mssql - RETVAL is hard-coded name</font> <br>$db-&gt;OutParameter($stmt,$ret,'RETVAL');<br>$db-&gt;Execute($stmt); </font></pre>
 
-<p><font color="#000000">Note that the only difference between the oci8 and mssql implementations is $sql.</font></p>
-<font color="#000000">  </font><p>
-<font color="#000000"> If $type parameter is set to false, in mssql, $type will be dynamicly determined 
+<p><font>Note that the only difference between the oci8 and mssql implementations is $sql.</font></p>
+<p>
+<font> If $type parameter is set to false, in mssql, $type will be dynamicly determined 
 based on the type of the PHP variable passed <font face="Courier New, Courier, mono">(string 
 =&gt; SQLCHAR, boolean =&gt;SQLINT1, integer =&gt;SQLINT4 or float/double=&gt;SQLFLT8)</font>.
-</font></p><p><font color="#000000"> 
+</font></p><p><font> 
 In oci8, $type can be set to OCI_B_FILE (Binary-File), OCI_B_CFILE (Character-File), 
 OCI_B_CLOB (Character-LOB), OCI_B_BLOB (Binary-LOB) and OCI_B_ROWID (ROWID). To 
 pass in a null, use<font face="Courier New, Courier, mono"> $db-&gt;Parameter($stmt, 
 $null=null, 'param')</font>. 
-  </font></p><p><font color="#000000"><b> OutParameter<a name="outparameter"></a>($stmt, $var, $name, 
+  </font></p><p><font><b> OutParameter<a name="outparameter"></a>($stmt, $var, $name, 
   $maxLen = 4000, $type = false )</b></font></p>
-<font color="#000000">  Binds a PHP variable as output from a stored procedure variable. The parameter <i>$stmt</i>
+<font>  Binds a PHP variable as output from a stored procedure variable. The parameter <i>$stmt</i>
  is the value returned by PrepareSP(), <i>$var</i> is the PHP variable you want to bind, <i>$name</i>
  is the name of the stored procedure variable. Optional is <i>$maxLen</i>, the maximum length of the
  data to bind, and <i>$type</i> which is database dependant. 
-  </font><p>
-<font color="#000000">  OutParameter() is a wrapper function that calls Parameter() with $isOutput=true. 
+</font><p>
+<font>  OutParameter() is a wrapper function that calls Parameter() with $isOutput=true. 
   The advantage of this function is that it is self-documenting, because
 the $isOutput parameter is no longer needed.  Only for mssql 
   and oci8 currently.
 </font></p><p>
-<font color="#000000">For an example, see <a href="#inparameter">InParameter</a>.
+<font>For an example, see <a href="#inparameter">InParameter</a>.
 
-</font></p><p><font color="#000000"><b> Parameter<a name="parameter"></a>($stmt, $var, $name, $isOutput=false, 
+</font></p><p><font><b> Parameter<a name="parameter"></a>($stmt, $var, $name, $isOutput=false, 
   $maxLen = 4000, $type = false )</b></font></p>
-<p><font color="#000000">Note: This function is deprecated, because of the new InParameter() and OutParameter() functions.
+<p><font>Note: This function is deprecated, because of the new InParameter() and OutParameter() functions.
 These are superior because they are self-documenting, unlike Parameter().
-</font></p><p><font color="#000000">Adds a bind parameter suitable for return values or special data handling (eg. 
+</font></p><p><font>Adds a bind parameter suitable for return values or special data handling (eg. 
   LOBs) after a statement has been prepared using PrepareSP(). Only for mssql 
   and oci8 currently. The parameters are:<br>
   <br>
@@ -2059,16 +2189,16 @@
   [$<b>type</b>] Consult <a href="http://php.net/mssql_bind">mssql_bind</a> and 
   <a href="http://php.net/ocibindbyname">ocibindbyname</a> docs at php.net for 
   more info on legal values for type.</font></p>
-<p><font color="#000000">Lastly, in oci8, bind parameters can be reused without calling PrepareSP( ) 
+<p><font>Lastly, in oci8, bind parameters can be reused without calling PrepareSP( ) 
   or Parameters again. This is not possible with mssql. An oci8 example:</font></p>
-<pre><font color="#000000">$id = 0; $i = 0;<br>$stmt = $db-&gt;PrepareSP( <font color="#993300">"update table set val=:i where id=:id"</font>);<br>$db-&gt;Parameter($stmt,$id,'id');<br>$db-&gt;Parameter($stmt,$i, 'i');<br>for ($cnt=0; $cnt &lt; 1000; $cnt++) {<br>	$id = $cnt; <br>	$i = $cnt * $cnt; <font color="green"># works with oci8!</font>
+<pre><font>$id = 0; $i = 0;<br>$stmt = $db-&gt;PrepareSP( <font color="#993300">"update table set val=:i where id=:id"</font>);<br>$db-&gt;Parameter($stmt,$id,'id');<br>$db-&gt;Parameter($stmt,$i, 'i');<br>for ($cnt=0; $cnt &lt; 1000; $cnt++) {<br>	$id = $cnt; <br>	$i = $cnt * $cnt; <font color="green"># works with oci8!</font>
 	$db-&gt;Execute($stmt); <br>}</font></pre>
-<p><font color="#000000"><b>Bind<a name="bind"></a>($stmt, $var, $size=4001, $type=false, $name=false)</b></font></p>
+<p><font><b>Bind<a name="bind"></a>($stmt, $var, $size=4001, $type=false, $name=false)</b></font></p>
  
-<p><font color="#000000">This is a low-level function supported only by the oci8 
+<p><font>This is a low-level function supported only by the oci8 
   driver. <b>Avoid using</b> unless you only want to support Oracle. The Parameter( 
   ) function is the recommended way to go with bind variables.</font></p>
-<p><font color="#000000">Bind( ) allows you to use bind variables in your sql 
+<p><font>Bind( ) allows you to use bind variables in your sql 
   statement. This binds a PHP variable to a name defined in an Oracle sql statement 
   that was previously prepared using Prepare(). Oracle named variables begin with 
   a colon, and ADOdb requires the named variables be called :0, :1, :2, :3, etc. 
@@ -2080,7 +2210,7 @@
   OCI_B_CLOB (Character-LOB), OCI_B_BLOB (Binary-LOB) and OCI_B_ROWID (ROWID). 
   Lastly, instead of using the default :0, :1, etc names, you can define your 
   own bind-name using $name. 
-</p><p><font color="#000000">The following example shows 3 bind variables being used: 
+</p><p><font>The following example shows 3 bind variables being used: 
   p1, p2 and p3. These variables are bound to :0, :1 and :2.</font></p>
 <pre>$stmt = $DB-&gt;Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)");<br>$DB-&gt;Bind($stmt, $p1);<br>$DB-&gt;Bind($stmt, $p2);<br>$DB-&gt;Bind($stmt, $p3);<br>for ($i = 0; $i &lt; $max; $i++) { <br>   $p1 = ?; $p2 = ?; $p3 = ?;<br>   $DB-&gt;Execute($stmt);<br>}</pre>
 <p>You can also use named variables:</p>
@@ -2141,7 +2271,7 @@
 create the table yourself). An example:
 </p><pre>	include('adodb.inc.php');<br>	include('adodb-perf.inc.php');<br>	adodb_perf::table('my_logsql_table');<br></pre>
 Also see <a href="docs-perf.htm">Performance Monitor</a>. 
-<p><font color="#000000"><b>fnExecute and fnCacheExecute properties<a name="fnexecute" id="fnexecute"></a></b></font></p>
+<p><font><b>fnExecute and fnCacheExecute properties<a name="fnexecute" id="fnexecute"></a></b></font></p>
 <p>These two properties allow you to define bottleneck functions for all sql statements 
   processed by ADOdb. This allows you to perform statistical analysis and query-rewriting 
   of your sql. 
@@ -2165,7 +2295,7 @@
 <p>The fnExecute function is called before the sql is parsed and executed, so 
   you can perform a query rewrite. If you are passing in a prepared statement, 
   then $sql is an array (see <a href="#prepare">Prepare</a>). The fnCacheExecute 
-  function is only called if the recordset returned was cached.<font color="#000000"> 
+  function is only called if the recordset returned was cached.<font> 
   The function parameters match the Execute and CacheExecute functions respectively, 
   except that $this (the connection object) is passed as the first parameter.</font></p>
 <p>Since ADOdb 3.91, the behaviour of fnExecute varies depending on whether the 
@@ -2175,524 +2305,629 @@
   of your own design. If this is the case, then have your function return a value. 
   If a value is returned, that value is returned immediately, without any further 
   processing. This is used internally by ADOdb to implement LogSQL() functionality. 
-</p><p> <font color="#000000"> 
-</font></p><hr>
-<h3><font color="#000000">ADOConnection Utility Functions</font></h3>
-<p><font color="#000000"><b>BlankRecordSet<a name="blankrecordset"></a>([$queryid])</b></font></p>
-<p><font color="#000000">No longer available - removed since 1.99.</font></p>
-<p><font color="#000000"><b>Concat<a name="concat"></a>($s1,$s2,....)</b></font></p>
-<p><font color="#000000">Generates the sql string used to concatenate $s1, $s2, etc together. Uses the 
+</p>
+<p>
+</p><hr>
+<h3><font>ADOConnection Utility Functions</font></h3>
+<p><font><b>BlankRecordSet<a name="blankrecordset"></a>([$queryid])</b></font></p>
+<p><font>No longer available - removed since 1.99.</font></p>
+<p><font><b>Concat<a name="concat"></a>($s1,$s2,....)</b></font></p>
+<p><font>Generates the sql string used to concatenate $s1, $s2, etc together. Uses the 
   string in the concat_operator field to generate the concatenation. Override 
   this function if a concatenation operator is not used, eg. MySQL.</font></p>
-<p><font color="#000000">Returns the concatenated string.</font></p>
-<p><font color="#000000"><b>DBDate<a name="dbdate"></a>($date)</b></font></p>
-<p><font color="#000000">Format the $<b>date</b> in the format the database accepts. This is used in 
+<p><font>Returns the concatenated string.</font></p>
+<p><font><b>DBDate<a name="dbdate"></a>($date)</b></font></p>
+<p><font>Format the $<b>date</b> in the format the database accepts. This is used in 
   INSERT/UPDATE statements; for SELECT statements, use <a href="#sqldate">SQLDate</a>. 
   The $<b>date</b> parameter can be a Unix integer timestamp or an ISO format 
   Y-m-d. Uses the fmtDate field, which holds the format to use. If null or false 
   or '' is passed in, it will be converted to an SQL null.</font></p>
-<p><font color="#000000">Returns the date as a quoted string.</font></p>
-<p><font color="#000000"><b>DBTimeStamp<a name="dbtimestamp"></a>($ts)</b></font></p>
-<p><font color="#000000">Format the timestamp $<b>ts</b> in the format the database accepts; this can 
+<p><font>Returns the date as a quoted string.</font></p>
+<p><font><b>DBTimeStamp<a name="dbtimestamp"></a>($ts)</b></font></p>
+<p><font>Format the timestamp $<b>ts</b> in the format the database accepts; this can 
   be a Unix integer timestamp or an ISO format Y-m-d H:i:s. Uses the fmtTimeStamp 
   field, which holds the format to use. If null or false or '' is passed in, it 
   will be converted to an SQL null.</font></p>
-<p><font color="#000000">Returns the timestamp as a quoted string.</font></p>
-<p><font color="#000000"><b>qstr<a name="qstr"></a>($s,[$magic_quotes_enabled</b>=false]<b>)</b></font></p>
-<p><font color="#000000">Quotes a string to be sent to the database. The $<b>magic_quotes_enabled</b> 
+<p><font>Returns the timestamp as a quoted string.</font></p>
+<p><font><b>qstr<a name="qstr"></a>($s,[$magic_quotes_enabled</b>=false]<b>)</b></font></p>
+<p><font>Quotes a string to be sent to the database. The $<b>magic_quotes_enabled</b> 
   parameter may look funny, but the idea is if you are quoting a string extracted 
   from a POST/GET variable, then pass get_magic_quotes_gpc() as the second parameter. 
   This will ensure that the variable is not quoted twice, once by <i>qstr</i> 
   and once by the <i>magic_quotes_gpc</i>.</font></p>
-<p><font color="#000000">Eg.<font face="Courier New, Courier, mono"> $s = $db-&gt;qstr(HTTP_GET_VARS['name'],get_magic_quotes_gpc());</font></font></p>
-<p><font color="#000000">Returns the quoted string.</font></p>
-<p><font color="#000000"><b>Quote<a name="quote"></a>($s)</b></font></p>
-<p><font color="#000000">Quotes the string $s, escaping the database specific quote character as appropriate. 
+<p><font>Eg.<font face="Courier New, Courier, mono"> $s = $db-&gt;qstr(HTTP_GET_VARS['name'],get_magic_quotes_gpc());</font></font></p>
+<p><font>Returns the quoted string.</font></p>
+<p><font><b>Quote<a name="quote"></a>($s)</b></font></p>
+<p><font>Quotes the string $s, escaping the database specific quote character as appropriate. 
   Formerly checked magic quotes setting, but this was disabled since 3.31 for 
   compatibility with PEAR DB. 
-</font></p><p><font color="#000000"><b>Affected_Rows<a name="affected_rows"></a>( )</b></font></p>
-<p><font color="#000000">Returns the number of rows affected by a update or delete statement. Returns 
+</font></p><p><font><b>Affected_Rows<a name="affected_rows"></a>( )</b></font></p>
+<p><font>Returns the number of rows affected by a update or delete statement. Returns 
   false if function not supported.</font></p>
-<p><font color="#000000">Not supported by interbase/firebird currently. </font></p>
-<p><font color="#000000"><b>Insert_ID<a name="inserted_id"></a>( )</b></font></p>
-<p><font color="#000000">Returns the last autonumbering ID inserted. Returns false if function not supported. 
+<p><font>Not supported by interbase/firebird currently. </font></p>
+<p><font><b>Insert_ID<a name="inserted_id"></a>( )</b></font></p>
+<p><font>Returns the last autonumbering ID inserted. Returns false if function not supported. 
 </font></p>
-<p><font color="#000000">Only supported by databases that support auto-increment or object id's, such 
+<p><font>Only supported by databases that support auto-increment or object id's, such 
   as PostgreSQL, MySQL and MS SQL Server currently. PostgreSQL returns the OID, which 
   can change on a database reload.</font></p>
-<p><font color="#000000"><b>RowLock<a name="rowlock"></a>($table,$where)</b></font></p>
-<p><font color="#000000">Lock a table row for the duration of a transaction. For example to lock record $id in table1:
-</font></p><pre><font color="#000000">	$DB-&gt;StartTrans();<br>	$DB-&gt;RowLock("table1","rowid=$id");<br>	$DB-&gt;Execute($sql1);<br>	$DB-&gt;Execute($sql2);<br>	$DB-&gt;CompleteTrans();<br></font></pre>
-<p><font color="#000000">Supported in db2, interbase, informix, mssql, oci8, postgres, sybase.
-</font></p><p><font color="#000000"><b>MetaDatabases<a name="metadatabases"></a>()</b></font></p>
-<p><font color="#000000">Returns a list of databases available on the server as an array. You have to 
+<p><font><b>RowLock<a name="rowlock"></a>($table,$where)</b></font></p>
+<p><font>Lock a table row for the duration of a transaction. For example to lock record $id in table1:
+</font></p><pre><font>	$DB-&gt;StartTrans();<br>	$DB-&gt;RowLock("table1","rowid=$id");<br>	$DB-&gt;Execute($sql1);<br>	$DB-&gt;Execute($sql2);<br>	$DB-&gt;CompleteTrans();<br></font></pre>
+<p><font>Supported in db2, interbase, informix, mssql, oci8, postgres, sybase.
+</font></p><p><font><b>MetaDatabases<a name="metadatabases"></a>()</b></font></p>
+<p><font>Returns a list of databases available on the server as an array. You have to 
   connect to the server first. Only available for ODBC, MySQL and ADO.</font></p>
-<p><font color="#000000"><b>MetaTables<a name="metatables"></a>($ttype = false, $showSchema = false, 
+<p><font><b>MetaTables<a name="metatables"></a>($ttype = false, $showSchema = false, 
   $mask=false)</b></font></p>
-<p><font color="#000000">Returns an array of tables and views for the current database as an array. 
+<p><font>Returns an array of tables and views for the current database as an array. 
   The array should exclude system catalog tables if possible. To only show tables, 
   use $db-&gt;MetaTables('TABLES'). To show only views, use $db-&gt;MetaTables('VIEWS'). 
   The $showSchema parameter currently works only for DB2, and when set to true, 
   will add the schema name to the table, eg. "SCHEMA.TABLE". </font></p>
-<p><font color="#000000">You can define a mask for matching. For example, setting $mask = 'TMP%' will 
+<p><font>You can define a mask for matching. For example, setting $mask = 'TMP%' will 
   match all tables that begin with 'TMP'. Currently only mssql, oci8, odbc_mssql 
   and postgres* support $mask. 
-</font></p><p><font color="#000000"><b>MetaColumns<a name="metacolumns"></a>($table,$toupper=true)</b></font></p>
-<p><font color="#000000">Returns an array of ADOFieldObject's, one field object for every column of 
+</font></p><p><font><b>MetaColumns<a name="metacolumns"></a>($table,$toupper=true)</b></font></p>
+<p><font>Returns an array of ADOFieldObject's, one field object for every column of 
   $table. A field object is a class instance with (name, type, max_length) defined.
   Currently Sybase does not recognise date types, and ADO cannot identify 
   the correct data type (so we default to varchar).   
- </font></p><p><font color="#000000"> The $toupper parameter determines whether we uppercase the table name 
+ </font></p><p><font> The $toupper parameter determines whether we uppercase the table name 
  (required for some databases).
- </font></p><p><font color="#000000">For schema support, pass in the $table parameter, "$schema.$tablename". This is only
+ </font></p><p><font>For schema support, pass in the $table parameter, "$schema.$tablename". This is only
  supported for selected databases.
-</font></p><p><font color="#000000"><b>MetaColumnNames<a name="metacolumnames"></a>($table,$numericIndex=false)</b></font></p>
-<p><font color="#000000">Returns an array of column names for $table. Since ADOdb 4.22, this is an associative array, with the
+</font></p><p><font><b>MetaColumnNames<a name="metacolumnames"></a>($table,$numericIndex=false)</b></font></p>
+<p><font>Returns an array of column names for $table. Since ADOdb 4.22, this is an associative array, with the
 keys in uppercase. Set $numericIndex=true if you want the old behaviour of numeric indexes (since 4.23).
 </font></p><p>
-<font color="#000000">e.g. array('FIELD1' =&gt; 'Field1', 'FIELD2'=&gt;'Field2')
+<font>e.g. array('FIELD1' =&gt; 'Field1', 'FIELD2'=&gt;'Field2')
 </font></p><p>
-</p><p><font color="#000000"><font color="#000000"><b>MetaPrimaryKeys<a name="metaprimarykeys"></a>($table, 
-  $owner=false)</b></font></font> 
-</p><p><font color="#000000">Returns an array containing column names that are the 
+</p><p><font><b>MetaPrimaryKeys<a name="metaprimarykeys"></a>($table,
+      $owner=false)</b></font> 
+</p>
+<p><font>Returns an array containing column names that are the 
   primary keys of $table. Supported by mysql, odbc (including db2, odbc_mssql, 
-  etc), mssql, postgres, interbase/firebird, oci8 currently. </font><font color="#000000"> 
-</font></p><p><font color="#000000">Views (and some tables) have primary keys, but sometimes this information is not available from the
+etc), mssql, postgres, interbase/firebird, oci8 currently. </font></p>
+<p><font>Views (and some tables) have primary keys, but sometimes this information is not available from the
 database. You can define a function  ADODB_View_PrimaryKeys($databaseType, $database, $view, $owner) that
 should return an array containing the fields that make up the primary key. If that function exists,
 it will be called when MetaPrimaryKeys() cannot find a primary key for a table or view.
-</font></p><pre><font color="#000000">// In this example: dbtype = 'oci8', $db = 'mydb', $view = 'dataView', $owner = false <br>function ADODB_View_PrimaryKeys($dbtype,$db,$view,$owner)<br>{<br>	switch(strtoupper($view)) {<br>	case 'DATAVIEW': return array('DATAID');<br>	default: return false;<br>	}<br>}<br><br>$db = NewADOConnection('oci8');<br>$db-&gt;Connect('localhost','root','','mydb'); <br>$db-&gt;MetaPrimaryKeys('dataView');<br></font></pre>
-<p><font color="#000000"><font color="#000000"><b>ServerInfo<a name="serverinfo" id="serverinfo"></a>($table)</b></font></font> 
-</p><p><font color="#000000">Returns an array of containing two elements 'description' 
+</font></p><pre><font>// In this example: dbtype = 'oci8', $db = 'mydb', $view = 'dataView', $owner = false <br>function ADODB_View_PrimaryKeys($dbtype,$db,$view,$owner)<br>{<br>	switch(strtoupper($view)) {<br>	case 'DATAVIEW': return array('DATAID');<br>	default: return false;<br>	}<br>}<br><br>$db = NewADOConnection('oci8');<br>$db-&gt;Connect('localhost','root','','mydb'); <br>$db-&gt;MetaPrimaryKeys('dataView');<br></font></pre>
+<p><font><b>ServerInfo<a name="serverinfo" id="serverinfo"></a>($table)</b></font> 
+</p>
+<p><font>Returns an array of containing two elements 'description' 
   and 'version'. The 'description' element contains the string description of 
   the database. The 'version' naturally holds the version number (which is also 
-  a string).</font><font color="#000000"> 
-</font></p><p><font color="#000000"><b>MetaForeignKeys<a name="metaforeignkeys"></a>($table, $owner=false, $upper=false)</b> 
-</font></p><p><font color="#000000">Returns an associate array of foreign keys, or false if not supported. For 
+a string).</font></p>
+<p><font><b>MetaForeignKeys<a name="metaforeignkeys"></a>($table, $owner=false, $upper=false)</b> 
+</font></p><p><font>Returns an associate array of foreign keys, or false if not supported. For 
   example, if table employee has a foreign key where employee.deptkey points to 
   dept_table.deptid, and employee.posn=posn_table.postionid and employee.poscategory=posn_table.category, 
   then $conn-&gt;MetaForeignKeys('employee') will return 
-</font></p><pre><font color="#000000">	array(<br>		'dept_table' =&gt; array('deptkey=deptid'),<br>		'posn_table' =&gt; array('posn=positionid','poscategory=category')<br>	)<br></font></pre>
-<p><font color="#000000">The optional schema or owner can be defined in $owner. If $upper is true, then 
+</font></p><pre><font>	array(<br>		'dept_table' =&gt; array('deptkey=deptid'),<br>		'posn_table' =&gt; array('posn=positionid','poscategory=category')<br>	)<br></font></pre>
+<p><font>The optional schema or owner can be defined in $owner. If $upper is true, then 
   the table names (array keys) are upper-cased. 
 </font></p><hr>
-<h2><font color="#000000">ADORecordSet<a name="adorecordset"></a></font></h2>
-<p><font color="#000000">When an SQL statement successfully is executed by <font face="Courier New, Courier, mono">ADOConnection-&gt;Execute($sql),</font>an 
+<h2><font>ADORecordSet<a name="adorecordset"></a></font></h2>
+<p><font>When an SQL statement successfully is executed by <font face="Courier New, Courier, mono">ADOConnection-&gt;Execute($sql),</font>an 
   ADORecordSet object is returned. This object contains a virtual cursor so we 
   can move from row to row, functions to obtain information about the columns 
   and column types, and helper functions to deal with formating the results to 
   show to the user.</font></p>
-<h3><font color="#000000">ADORecordSet Fields</font></h3>
-<p><font color="#000000"><b>fields: </b>Array containing the current row. This is not associative, but 
+<h3><font>ADORecordSet Fields</font></h3>
+<p><font><b>fields: </b>Array containing the current row. This is not associative, but 
   is an indexed array from 0 to columns-1. See also the function <b><a href="#fields">Fields</a></b>, 
   which behaves like an associative array.</font></p>
-<p><font color="#000000"><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
+<p><font><b>dataProvider</b>: The underlying mechanism used to connect to the database. 
   Normally set to <b>native</b>, unless using <b>odbc</b> or <b>ado</b>.</font></p>
-<p><font color="#000000"><b>blobSize</b>: Maximum size of a char, string or varchar object before it 
+<p><font><b>blobSize</b>: Maximum size of a char, string or varchar object before it 
   is treated as a Blob (Blob's should be shown with textarea's). See the <a href="#metatype">MetaType</a> 
   function.</font></p>
-<p><font color="#000000"><b>sql</b>: Holds the sql statement used to generate this record set.</font></p>
-<p><font color="#000000"><b>canSeek</b>: Set to true if Move( ) function works.</font></p>
-<p><font color="#000000"><b>EOF</b>: True if we have scrolled the cursor past the last record.</font></p>
-<h3><font color="#000000">ADORecordSet Functions</font></h3>
-<p><font color="#000000"><b>ADORecordSet( )</b></font></p>
-<p><font color="#000000">Constructer. Normally you never call this function yourself.</font></p>
-<p><font color="#000000"><b>GetAssoc<a name="getassoc"></a>([$force_array])</b></font></p>
-<p><font color="#000000">Generates an associative array from the recordset. Note that is this function 
+<p><font><b>sql</b>: Holds the sql statement used to generate this record set.</font></p>
+<p><font><b>canSeek</b>: Set to true if Move( ) function works.</font></p>
+<p><font><b>EOF</b>: True if we have scrolled the cursor past the last record.</font></p>
+<h3><font>ADORecordSet Functions</font></h3>
+<p><font><b>ADORecordSet( )</b></font></p>
+<p><font>Constructer. Normally you never call this function yourself.</font></p>
+<p><font><b>GetAssoc<a name="getassoc"></a>([$force_array])</b></font></p>
+<p><font>Generates an associative array from the recordset. Note that is this function 
   is also <a href="#getassoc1">available</a> in the connection object. More details 
   can be found there.</font></p>
-<font color="#000000"><font color="#000000"> </font></font><font color="#000000"><font color="#000000">
-</font></font><p><font color="#000000"><font color="#000000"><b>GetArray<a name="getarray"></a>([$number_of_rows])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Generate a 2-dimensional array of records from the current cursor position, 
-  indexed from 0 to $number_of_rows - 1. If $number_of_rows is undefined, till 
-  EOF.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>GetRows<a name="getrows"></a>([$number_of_rows])</b></font></font></p>
-<font color="#000000"><font color="#000000">Generate a 2-dimensional array of records from the current cursor position. Synonym 
-for GetArray() for compatibility with Microsoft ADO. 
-</font></font><p><font color="#000000"><font color="#000000"> <b>GetMenu<a name="getmenu"></a>($name, [$default_str=''], [$blank1stItem=true], 
-  [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Generate a HTML menu (&lt;select&gt;&lt;option&gt;&lt;option&gt;&lt;/select&gt;). 
-  The first column of the recordset (fields[0]) will hold the string to display 
-  in the option tags. If the recordset has more than 1 column, the second column 
-  (fields[1]) is the value to send back to the web server.. The menu will be given 
-  the name $<i>name</i>. 
-</font></font></p><p><font color="#000000"><font color="#000000"> If $<i>default_str</i> is defined, then if $<i>default_str</i> == fields[0], 
-  that field is selected. If $<i>blank1stItem</i> is true, the first option is 
-  empty. You can also set the first option strings by setting $blank1stItem = 
-  "$value:$text".</font></font></p>
-<p><font color="#000000"><font color="#000000">$<i>Default_str</i> can be array for a multiple select listbox.</font></font></p>
-<p><font color="#000000"><font color="#000000">To get a listbox, set the $<i>size</i> to a non-zero value (or pass $default_str 
-  as an array). If $<i>multiple_select</i> is true then a listbox will be generated 
-  with $<i>size</i> items (or if $size==0, then 5 items) visible, and we will 
-  return an array to a server. Lastly use $<i>moreAttr </i> to add additional 
-  attributes such as javascript or styles. </font></font></p>
-<p><font color="#000000"><font color="#000000">Menu Example 1: <code>GetMenu('menu1','A',true)</code> will generate a menu: 
-  <select name="menu1"><option> 
-    </option><option value="1" selected="selected">A 
-    </option><option value="2">B 
-    </option><option value="3">C 
-  </option></select>
-  for the data (A,1), (B,2), (C,3). Also see <a href="#ex5">example 5</a>.</font></font></p>
-<p><font color="#000000"><font color="#000000">Menu Example 2: For the same data, <code>GetMenu('menu1',array('A','B'),false)</code> 
-  will generate a menu with both A and B selected: <br>
-  <select name="menu1" multiple="multiple" size="3"><option value="1" selected="selected">A 
-    </option><option value="2" selected="selected">B 
-    </option><option value="3">C 
-  </option></select>
-</font></font></p><p><font color="#000000"><font color="#000000"> <b>GetMenu2<a name="getmenu2"></a>($name, [$default_str=''], [$blank1stItem=true], 
-  [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">This is nearly identical to GetMenu, except that the $<i>default_str</i> is 
-  matched to fields[1] (the option values).</font></font></p>
-<p><font color="#000000"><font color="#000000">Menu Example 3: Given the data in menu example 2, <code>GetMenu2('menu1',array('1','2'),false)</code> 
-  will generate a menu with both A and B selected in menu example 2, but this 
-  time the selection is based on the 2nd column, which holds the values to return 
-  to the Web server. 
-</font></font></p><p><font color="#000000"><font color="#000000"><b>UserDate<a name="userdate"></a>($str, [$fmt])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Converts the date string $<i>str</i> to another format. The date format is Y-m-d,
-or Unix timestamp format. The default $<i>fmt</i> is Y-m-d.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>UserTimeStamp<a name="usertimestamp"></a>($str, [$fmt])</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Converts the timestamp string $<b>str</b> to another format. The timestamp 
-  format is Y-m-d H:i:s, as in '2002-02-28 23:00:12', or Unix timestamp format.
-   UserTimeStamp calls UnixTimeStamp to parse $<i>str</i>, and $<i>fmt</i> defaults to Y-m-d H:i:s if not defined. 
-</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>UnixDate<a name="unixdate"></a>($str)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Parses the date string $<b>str</b> and returns it in unix mktime format (eg. 
-  a number indicating the seconds after January 1st, 1970). Expects the date to 
-  be in Y-m-d H:i:s format, except for Sybase and Microsoft SQL Server, where 
-  M d Y is also accepted (the 3 letter month strings are controlled by a global 
-  array, which might need localisation).</font></font></p>
-<p><font color="#000000"><font color="#000000">This function is available in both ADORecordSet and ADOConnection since 1.91.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>UnixTimeStamp<a name="unixtimestamp"></a>($str)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Parses the timestamp string $<b>str</b>
-and returns it in unix mktime format (eg. a number indicating the
-seconds after January 1st, 1970). Expects the date to be in "Y-m-d,
-H:i:s" (1970-12-24, 00:00:00) or "Y-m-d H:i:s" (1970-12-24 00:00:00) or
-"YmdHis" (19701225000000) format, except for Sybase and Microsoft SQL
-Server, where "M d Y h:i:sA" (Dec 25 1970 00:00:00AM) is also accepted
-(the 3 letter month strings are controlled by a global array, which
-might need localisation).</font></font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><font color="#000000">This function is available in both ADORecordSet and ADOConnection 
-  since 1.91. </font></font></p>
-<p><font color="#000000"><font color="#000000"><b>OffsetDate<a name="offsetdate"></a>($dayFraction, 
-  $basedate=false)</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><font color="#000000">Returns a string </font>with the 
-  native SQL functions to calculate future and past dates based on $basedate in 
-  a portable fashion. If $basedate is not defined, then the current date (at 12 
-  midnight) is used. Returns the SQL string that performs the calculation when 
-  passed to Execute(). </font></font></p>
-<p><font color="#000000"><font color="#000000">For example, in Oracle, to find the date and time that 
-  is 2.5 days from today, you can use:</font></font></p>
-<pre><font color="#000000"><font color="#000000"># get date one week from now<br>$fld = $conn-&gt;OffsetDate(7); // returns "(trunc(sysdate)+7")</font></font></pre>
-<pre><font color="#000000"><font color="#000000"># get date and time that is 60 hours from current date and time<br>$fld = $conn-&gt;OffsetDate(2.5, $conn-&gt;sysTimeStamp);	// returns "(sysdate+2.5)"</font>
-
-$conn-&gt;Execute("UPDATE TABLE SET dodate=$fld WHERE ID=$id");</font></pre>
-<p><font color="#000000"> This function is available for mysql, mssql, oracle, oci8 and postgresql drivers 
-  since 2.13. It might work with other drivers<font color="#000000"> provided 
-  they allow performing numeric day arithmetic on dates.</font></font></p>
-<font color="#000000"><font color="#000000"> 
-</font></font><p><font color="#000000"><font color="#000000"><font color="#000000"><b>SQLDate<a name="sqldate"></a>($dateFormat, $basedate=false)</b></font></font></font></p>
-<font color="#000000"><font color="#000000">Returns a string which contains the native SQL functions to format a date or date 
-column $basedate. This is used in SELECT statements. For INSERT/UPDATE statements, 
-use <a href="#dbdate">DBDate</a>. It uses a case-sensitive $dateFormat, which 
-supports: 
-</font></font><pre><font color="#000000"><font color="#000000"> Y: 4-digit Year<br> Q: Quarter (1-4)<br> M: Month (Jan-Dec)<br> m: Month (01-12)<br> d: Day (01-31)<br> H: Hour (00-23)<br> h: Hour (1-12)<br> i: Minute (00-59)<br> s: Second (00-60)<br> A: AM/PM indicator</font></font></pre>
-<p><font color="#000000"><font color="#000000">All other characters are treated as strings. You can also use \ to escape characters. 
-  Available on selected databases, including mysql, postgresql, mssql, oci8 and 
-  DB2. 
-</font></font></p><p><font color="#000000"><font color="#000000">This is useful in writing portable sql statements that GROUP BY on dates. For 
-  example to display total cost of goods sold broken by quarter (dates are stored 
-  in a field called postdate): 
-</font></font></p><pre><font color="#000000"><font color="#000000"> $sqlfn = $db-&gt;SQLDate('Y-\QQ','postdate'); # get sql that formats postdate to output 2002-Q1<br> $sql = "SELECT $sqlfn,SUM(cogs) FROM table GROUP BY $sqlfn ORDER BY 1 desc";<br> </font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>MoveNext<a name="movenext"></a>( )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Move the internal cursor to the next row. The <i>$this-&gt;fields</i> array is 
-  automatically updated. Returns false if unable to do so (normally because EOF 
-  has been reached), otherwise true. 
-</font></font></p><p><font color="#000000"><font color="#000000"> If EOF is reached, then the $this-&gt;fields array is set to false (this was 
-  only implemented consistently in ADOdb 3.30). For the pre-3.30 behaviour of 
-  $this-&gt;fields (at EOF), set the global variable $ADODB_COMPAT_FETCH = true.</font></font></p>
-<p><font color="#000000"><font color="#000000">Example:</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute($sql);<br>if ($rs) <br>	while (!$rs-&gt;EOF) {<br> 		ProcessArray($rs-&gt;fields);	<br>		$rs-&gt;MoveNext();<br>	} </font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>Move<a name="move"></a>($to)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Moves the internal cursor to a specific row $<b>to</b>. Rows are zero-based 
-  eg. 0 is the first row. The <b>fields</b> array is automatically updated. For 
-  databases that do not support scrolling internally, ADOdb will simulate forward 
-  scrolling. Some databases do not support backward scrolling. If the $<b>to</b> 
-  position is after the EOF, $<b>to</b> will move to the end of the RecordSet 
-  for most databases. Some obscure databases using odbc might not behave this 
-  way.</font></font></p>
-<p><font color="#000000"><font color="#000000">Note: This function uses <i>absolute positioning</i>, unlike Microsoft's ADO.</font></font></p>
-<p><font color="#000000"><font color="#000000">Returns true or false. If false, the internal cursor is not moved in most implementations, 
-  so AbsolutePosition( ) will return the last cursor position before the Move( 
-  ). </font></font></p>
-<p><font color="#000000"><font color="#000000"><b>MoveFirst<a name="movefirst"></a>()</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Internally calls Move(0). Note that some databases do not support this function.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>MoveLast<a name="movelast"></a>()</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Internally calls Move(RecordCount()-1). Note that some databases do not support 
-  this function.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>GetRowAssoc</b><a name="getrowassoc"></a>($toUpper=true)</font></font></p>
-<p><font color="#000000"><font color="#000000">Returns an associative array containing the current row. The keys to the array 
-  are the column names. The column names are upper-cased for easy access. To get 
-  the next row, you will still need to call MoveNext(). </font></font></p>
-<p><font color="#000000"><font color="#000000">For example:<br>
-  Array ( [ID] =&gt; 1 [FIRSTNAME] =&gt; Caroline [LASTNAME] =&gt; Miranda [CREATED] =&gt; 
-  2001-07-05 ) </font></font></p>
-<p><font color="#000000"><font color="#000000">Note: do not use GetRowAssoc() with $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC. 
-  Because they have the same functionality, they will interfere with each other.</font></font></p>
-<font color="#000000"> 
-</font><p><font color="#000000"><font color="#000000"><b>AbsolutePage<a name="absolutepage"></a>($page=-1) 
-  </b></font></font></p>
-<p><font color="#000000">Returns the current page. Requires PageExecute()/CachePageExecute() to be called. 
+<font> </font>
+<p><font><b>GetArray<a name="getarray"></a>([$number_of_rows])</b></font></p>
+<p><font>Generate a 2-dimensional array of records from the current
+    cursor position, indexed from 0 to $number_of_rows - 1. If $number_of_rows
+  is undefined, till EOF.</font></p>
+<p><font><b>GetRows<a name="getrows"></a>([$number_of_rows])</b></font></p>
+<font>Generate a 2-dimensional array of records from the current
+cursor position. Synonym for GetArray() for compatibility with Microsoft ADO. </font>
+<p><font> <b>GetMenu<a name="getmenu"></a>($name, [$default_str=''],
+  [$blank1stItem=true], [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></p>
+<p><font>Generate a HTML menu (&lt;select&gt;&lt;option&gt;&lt;option&gt;&lt;/select&gt;).
+    The first column of the recordset (fields[0]) will hold the string to display
+    in the option tags. If the recordset has more than 1 column, the second column
+    (fields[1]) is the value to send back to the web server.. The menu will be
+given the name $<i>name</i>. </font></p>
+<p><font> If $<i>default_str</i> is defined, then if $<i>default_str</i> ==
+    fields[0], that field is selected. If $<i>blank1stItem</i> is true, the first
+    option is empty. You can also set the first option strings by setting $blank1stItem
+  = "$value:$text".</font></p>
+<p><font>$<i>Default_str</i> can be array for a multiple select
+listbox.</font></p>
+<p><font>To get a listbox, set the $<i>size</i> to a non-zero
+    value (or pass $default_str as an array). If $<i>multiple_select</i> is true
+    then a listbox will be generated with $<i>size</i> items (or if $size==0,
+    then 5 items) visible, and we will return an array to a server. Lastly use
+  $<i>moreAttr </i> to add additional attributes such as javascript or styles. </font></p>
+<p><font>Menu Example 1: <code>GetMenu('menu1','A',true)</code> will
+    generate a menu:
+    <select name="menu1"><option> </option><option value="1" selected="selected">A </option><option value="2">B </option><option value="3">C </option></select>
+for the data (A,1), (B,2), (C,3). Also see <a href="#ex5">example 5</a>.</font></p>
+<p><font>Menu Example 2: For the same data, <code>GetMenu('menu1',array('A','B'),false)</code> will
+    generate a menu with both A and B selected: <br>
+    <select name="menu1" multiple="multiple" size="3"><option value="1" selected="selected">A </option><option value="2" selected="selected">B </option><option value="3">C </option></select>
+</font></p>
+<p><font> <b>GetMenu2<a name="getmenu2"></a>($name, [$default_str=''],
+  [$blank1stItem=true], [$multiple_select=false], [$size=0], [$moreAttr=''])</b></font></p>
+<p><font>This is nearly identical to GetMenu, except that the
+  $<i>default_str</i> is matched to fields[1] (the option values).</font></p>
+<p><font>Menu Example 3: Given the data in menu example 2, <code>GetMenu2('menu1',array('1','2'),false)</code> will
+    generate a menu with both A and B selected in menu example 2, but this time
+    the selection is based on the 2nd column, which holds the values to return
+to the Web server. </font></p>
+<p><font><b>UserDate<a name="userdate"></a>($str, [$fmt])</b></font></p>
+<p><font>Converts the date string $<i>str</i> to another format.
+    The date format is Y-m-d, or Unix timestamp format. The default $<i>fmt</i> is
+Y-m-d.</font></p>
+<p><font><b>UserTimeStamp<a name="usertimestamp"></a>($str, [$fmt])</b></font></p>
+<p><font>Converts the timestamp string $<b>str</b> to another
+    format. The timestamp format is Y-m-d H:i:s, as in '2002-02-28 23:00:12',
+    or Unix timestamp format. UserTimeStamp calls UnixTimeStamp to parse $<i>str</i>,
+and $<i>fmt</i> defaults to Y-m-d H:i:s if not defined. </font></p>
+<p><font><b>UnixDate<a name="unixdate"></a>($str)</b></font></p>
+<p><font>Parses the date string $<b>str</b> and returns it in
+    unix mktime format (eg. a number indicating the seconds after January 1st,
+    1970). Expects the date to be in Y-m-d H:i:s format, except for Sybase and
+    Microsoft SQL Server, where M d Y is also accepted (the 3 letter month strings
+  are controlled by a global array, which might need localisation).</font></p>
+<p><font>This function is available in both ADORecordSet and
+ADOConnection since 1.91.</font></p>
+<p><font><b>UnixTimeStamp<a name="unixtimestamp"></a>($str)</b></font></p>
+<p><font>Parses the timestamp string $<b>str</b> and returns
+    it in unix mktime format (eg. a number indicating the seconds after January
+    1st, 1970). Expects the date to be in "Y-m-d, H:i:s" (1970-12-24, 00:00:00)
+    or "Y-m-d H:i:s" (1970-12-24 00:00:00) or "YmdHis" (19701225000000) format,
+    except for Sybase and Microsoft SQL Server, where "M d Y h:i:sA" (Dec 25
+    1970 00:00:00AM) is also accepted (the 3 letter month strings are controlled
+by a global array, which might need localisation).</font></p>
+<font> 
+</font><p><font>This function is available in both ADORecordSet
+    and ADOConnection since 1.91. </font></p>
+<p><font><b>OffsetDate<a name="offsetdate"></a>($dayFraction,
+  $basedate=false)</b></font></p>
+<p><font>Returns a string with the native SQL functions to calculate
+    future and past dates based on $basedate in a portable fashion. If $basedate
+    is not defined, then the current date (at 12 midnight) is used. Returns the
+  SQL string that performs the calculation when passed to Execute(). </font></p>
+<p><font>For example, in Oracle, to find the date and time that
+  is 2.5 days from today, you can use:</font></p>
+<pre><font># get date one week from now<br>$fld = $conn-&gt;OffsetDate(7); // returns "(trunc(sysdate)+7")</font></pre>
+<pre><font># get date and time that is 60 hours from current date and time<br>$fld = $conn-&gt;OffsetDate(2.5, $conn-&gt;sysTimeStamp);	// returns "(sysdate+2.5)"<br><br>$conn-&gt;Execute("UPDATE TABLE SET dodate=$fld WHERE ID=$id");</font></pre>
+<p><font> This function is available for mysql, mssql, oracle, oci8 and postgresql drivers 
+  since 2.13. It might work with other drivers provided they allow performing
+  numeric day arithmetic on dates.</font></p>
+<font> </font>
+<p><font><b>SQLDate<a name="sqldate"></a>($dateFormat, $basedate=false)</b></font></p>
+<font>Returns a string which contains the native SQL functions
+to format a date or date column $basedate. This is used in SELECT statements.
+For INSERT/UPDATE statements, use <a href="#dbdate">DBDate</a>. It uses a case-sensitive
+$dateFormat, which supports: </font>
+<pre><font> 
+  Y: 4-digit Year
+  Q: Quarter (1-4)
+  M: Month (Jan-Dec)
+  m: Month (01-12)
+  d: Day (01-31)
+  H: Hour (00-23)
+  h: Hour (1-12)
+  i: Minute (00-59)
+  s: Second (00-60)
+  A: AM/PM indicator
+  w: day of week (0-6 or 1-7 depending on DB)
+  l: day of week (as string - lowercase L)
+  </font></pre>
+<p><font>All other characters are treated as strings. You can
+    also use \ to escape characters. Available on selected databases, including
+mysql, postgresql, mssql, oci8 and DB2. </font></p>
+<p><font>This is useful in writing portable sql statements that
+    GROUP BY on dates. For example to display total cost of goods sold broken
+by quarter (dates are stored in a field called postdate): </font></p>
+<pre><font> $sqlfn = $db-&gt;SQLDate('Y-\QQ','postdate'); # get sql that formats postdate to output 2002-Q1<br> $sql = "SELECT $sqlfn,SUM(cogs) FROM table GROUP BY $sqlfn ORDER BY 1 desc";<br> </font></pre>
+<p><font><b>MoveNext<a name="movenext"></a>( )</b></font></p>
+<p><font>Move the internal cursor to the next row. The <i>$this-&gt;fields</i> array
+    is automatically updated. Returns false if unable to do so (normally because
+EOF has been reached), otherwise true. </font></p>
+<p><font> If EOF is reached, then the $this-&gt;fields array
+    is set to false (this was only implemented consistently in ADOdb 3.30). For
+    the pre-3.30 behaviour of $this-&gt;fields (at EOF), set the global variable
+  $ADODB_COMPAT_FETCH = true.</font></p>
+<p><font>Example:</font></p>
+<pre><font>$rs = $db-&gt;Execute($sql);<br>if ($rs) <br>	while (!$rs-&gt;EOF) {<br> 		ProcessArray($rs-&gt;fields);	<br>		$rs-&gt;MoveNext();<br>	} </font></pre>
+<p><font><b>Move<a name="move"></a>($to)</b></font></p>
+<p><font>Moves the internal cursor to a specific row $<b>to</b>.
+    Rows are zero-based eg. 0 is the first row. The <b>fields</b> array is automatically
+    updated. For databases that do not support scrolling internally, ADOdb will
+    simulate forward scrolling. Some databases do not support backward scrolling.
+    If the $<b>to</b> position is after the EOF, $<b>to</b> will move to the
+    end of the RecordSet for most databases. Some obscure databases using odbc
+  might not behave this way.</font></p>
+<p><font>Note: This function uses <i>absolute positioning</i>,
+unlike Microsoft's ADO.</font></p>
+<p><font>Returns true or false. If false, the internal cursor
+    is not moved in most implementations, so AbsolutePosition( ) will return
+  the last cursor position before the Move( ). </font></p>
+<p><font><b>MoveFirst<a name="movefirst"></a>()</b></font></p>
+<p><font>Internally calls Move(0). Note that some databases do
+not support this function.</font></p>
+<p><font><b>MoveLast<a name="movelast"></a>()</b></font></p>
+<p><font>Internally calls Move(RecordCount()-1). Note that some
+  databases do not support this function.</font></p>
+<p><font><b>GetRowAssoc</b><a name="getrowassoc"></a>($toUpper=true)</font></p>
+<p><font>Returns an associative array containing the current
+    row. The keys to the array are the column names. The column names are upper-cased
+  for easy access. To get the next row, you will still need to call MoveNext(). </font></p>
+<p><font>For example:<br>
+Array ( [ID] =&gt; 1 [FIRSTNAME] =&gt; Caroline [LASTNAME] =&gt; Miranda [CREATED]
+=&gt; 2001-07-05 ) </font></p>
+<p><font>Note: do not use GetRowAssoc() with $ADODB_FETCH_MODE
+    = ADODB_FETCH_ASSOC. Because they have the same functionality, they will
+  interfere with each other.</font></p>
+<font> 
+</font><p><font><b>AbsolutePage<a name="absolutepage"></a>($page=-1) </b></font></p>
+<p><font>Returns the current page. Requires PageExecute()/CachePageExecute() to be called. 
   See <a href="#ex8">Example 8</a>.</font></p>
-<font color="#000000"><font color="#000000"> 
+<font>
 <p><b>AtFirstPage<a name="atfirstpage">($status='')</a></b></p>
-<p>Returns true if at first page (1-based). Requires PageExecute()/CachePageExecute() 
+<p>Returns true if at first page (1-based). Requires PageExecute()/CachePageExecute()
   to be called. See <a href="#ex8">Example 8</a>.</p>
 <p><b>AtLastPage<a name="atlastpage">($status='')</a></b></p>
-<p>Returns true if at last page (1-based). Requires PageExecute()/CachePageExecute() 
+<p>Returns true if at last page (1-based). Requires PageExecute()/CachePageExecute()
   to be called. See <a href="#ex8">Example 8</a>.</p>
 <p><b>Fields</b><a name="fields"></a>(<b>$colname</b>)</p>
-<p>Returns the value of the 
-  associated column $<b>colname</b> for the current row. The column name is case-insensitive.</p>
+<p>Returns the value of the associated column $<b>colname</b> for the current
+  row. The column name is case-insensitive.</p>
 <p>This is a convenience function. For higher performance, use <a href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a>. </p>
-<p><b>FetchRow</b><a name="fetchrow"></a>()</p>
-</font> 
-</font><p><font color="#000000"><font color="#000000">Returns array containing current row, or false if EOF. 
-  FetchRow( ) internally moves to the next record after returning the current 
-  row. </font></font></p>
-<p><font color="#000000"><font color="#000000">Warning: Do not mix using FetchRow() with MoveNext().</font></font></p>
-<p><font color="#000000"><font color="#000000">Usage:</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute($sql);<br>if ($rs)<br>	while ($arr = $rs-&gt;FetchRow()) {<br>	   &nbsp;&nbsp;# process $arr	<br></font><font color="#000000">	}</font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>FetchInto</b><a name="fetchinto"></a>(<b>&amp;$array</b>)</font></font></p>
-<p><font color="#000000"><font color="#000000"> Sets $array to the current row. Returns PEAR_Error object 
-  if EOF, 1 if ok (DB_OK constant). If PEAR is undefined, false is returned when 
-  EOF. </font><font color="#000000">FetchInto( ) internally moves to the next 
-  record after returning the current row. </font></font></p>
-<p><font color="#000000"><font color="#000000"> FetchRow() is easier to use. See above.</font></font></p>
-<font color="#000000"><font color="#000000"> 
-</font></font><p><font color="#000000"><font color="#000000"><b>FetchField<a name="fetchfield"></a>($column_number)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns an object containing the <b>name</b>, <b>type</b> and <b>max_length</b> 
-  of the associated field. If the max_length cannot be determined reliably, it 
-  will be set to -1. The column numbers are zero-based. See <a href="#ex2">example 
-  2.</a></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>FieldCount<a name="fieldcount"></a>( )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the number of fields (columns) in the record set.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>RecordCount<a name="recordcount"></a>( )</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the number of rows in the record set. If the number of records returned 
-  cannot be determined from the database driver API, we will buffer all rows and 
-  return a count of the rows after all the records have been retrieved. This buffering 
-  can be disabled (for performance reasons) by setting the global variable $ADODB_COUNTRECS 
-  = false. When disabled, RecordCount( ) will return -1 for certain databases. 
-  See the supported databases list above for more details. </font></font></p>
-<p><font color="#000000"><font color="#000000"> RowCount is a synonym for RecordCount.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>PO_RecordCount<a name="po_recordcount"></a>($table, $where)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the number of rows in the record set. If the database does not support 
-  this, it will perform a SELECT COUNT(*) on the table $table, with the given 
-  $where condition to return an estimate of the recordset size.</font></font></p>
-<p><font color="#000000"><font color="#000000">$numrows = $rs-&gt;PO_RecordCount("articles_table", "group=$group");</font></font></p>
-<font color="#000000"><font color="#000000"><b> NextRecordSet<a name="nextrecordset" id="nextrecordset"></a>()</b> 
-</font></font><p><font color="#000000"><font color="#000000">For databases that allow multiple recordsets to be returned in one query, this 
-  function allows you to switch to the next recordset. Currently only supported 
-  by mssql driver.</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute('execute return_multiple_rs');<br>$arr1 = $rs-&gt;GetArray();<br>$rs-&gt;NextRecordSet();<br>$arr2 = $rs-&gt;GetArray();</font></font></pre>
-<p><font color="#000000"><font color="#000000"><b>FetchObject<a name="fetchobject"></a>($toupper=true)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the current row as an object. If you set $toupper to true, then the 
-  object fields are set to upper-case. Note: The newer FetchNextObject() is the 
-  recommended way of accessing rows as objects. See below.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>FetchNextObject<a name="fetchnextobject"></a>($toupper=true)</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Gets the current row as an object and moves to the next row automatically. 
-  Returns false if at end-of-file. If you set $toupper to true, then the object 
-  fields are set to upper-case.</font></font></p>
-<pre><font color="#000000"><font color="#000000">$rs = $db-&gt;Execute('select firstname,lastname from table');<br>if ($rs) {<br>	while ($o = $rs-&gt;FetchNextObject()) {<br>		print "$o-&gt;FIRSTNAME, $o-&gt;LASTNAME&lt;BR&gt;";<br>	}<br>}<br></font></font></pre>
-<p><font color="#000000"><font color="#000000">There is some trade-off in speed in using FetchNextObject(). If performance 
-  is important, you should access rows with the <code>fields[]</code> array. <b>FetchObj<a name="fetchobj" id="fetchobj"></a>()</b> 
-</font></font></p><p><font color="#000000"><font color="#000000">Returns the current record as an object. Fields are not upper-cased, unlike 
-  FetchObject. </font> 
-</font></p><p><font color="#000000"><font color="#000000"><b>FetchNextObj<a name="fetchnextobj" id="fetchnextobj"></a>()</b> 
-  </font></font></p>
-<p><font color="#000000"><font color="#000000">Returns the current record as an object and moves to 
-  the next record. If EOF, false is returned. Fields are not upper-cased, unlike 
-  FetctNextObject. </font></font></p>
-<font color="#000000"><font color="#000000"> 
+<p><b>FetchRow</b><a name="fetchrow"></a>()</p> 
+</font><p><font>Returns array containing current row, or false
+    if EOF. FetchRow( ) internally moves to the next record after returning the
+    current row. </font></p>
+<p><font>Warning: Do not mix using FetchRow() with MoveNext().</font></p>
+<p><font>Usage:</font></p>
+<pre><font>$rs = $db-&gt;Execute($sql);<br>if ($rs)<br>	while ($arr = $rs-&gt;FetchRow()) {<br>	   &nbsp;&nbsp;# process $arr	<br>	}</font></pre>
+<p><font><b>FetchInto</b><a name="fetchinto"></a>(<b>&amp;$array</b>)</font></p>
+<p><font> Sets $array to the current row. Returns PEAR_Error
+    object if EOF, 1 if ok (DB_OK constant). If PEAR is undefined, false is returned
+    when EOF. FetchInto( ) internally moves to the next record after returning
+  the current row. </font></p>
+<p><font> FetchRow() is easier to use. See above.</font></p>
+<font> </font>
+<p><font><b>FetchField<a name="fetchfield"></a>($column_number)</b></font></p>
+<p><font>Returns an object containing the <b>name</b>, <b>type</b> and <b>max_length</b> of
+    the associated field. If the max_length cannot be determined reliably, it
+    will be set to -1. The column numbers are zero-based. See <a href="#ex2">example
+  2.</a></font></p>
+<p><font><b>FieldCount<a name="fieldcount"></a>( )</b></font></p>
+<p><font>Returns the number of fields (columns) in the record
+set.</font></p>
+<p><font><b>RecordCount<a name="recordcount"></a>( )</b></font></p>
+<p><font>Returns the number of rows in the record set. If the
+    number of records returned cannot be determined from the database driver
+    API, we will buffer all rows and return a count of the rows after all the
+    records have been retrieved. This buffering can be disabled (for performance
+    reasons) by setting the global variable $ADODB_COUNTRECS = false. When disabled,
+    RecordCount( ) will return -1 for certain databases. See the supported databases
+  list above for more details. </font></p>
+<p><font> RowCount is a synonym for RecordCount.</font></p>
+<p><font><b>PO_RecordCount<a name="po_recordcount"></a>($table,
+$where)</b></font></p>
+<p><font>Returns the number of rows in the record set. If the
+    database does not support this, it will perform a SELECT COUNT(*) on the
+    table $table, with the given $where condition to return an estimate of the
+  recordset size.</font></p>
+<p><font>$numrows = $rs-&gt;PO_RecordCount("articles_table", "group=$group");</font></p>
+<font><b> NextRecordSet<a name="nextrecordset" id="nextrecordset"></a>()</b> </font>
+<p><font>For databases that allow multiple recordsets to be returned
+    in one query, this function allows you to switch to the next recordset. Currently
+  only supported by mssql driver.</font></p>
+<pre><font>$rs = $db-&gt;Execute('execute return_multiple_rs');<br>$arr1 = $rs-&gt;GetArray();<br>$rs-&gt;NextRecordSet();<br>$arr2 = $rs-&gt;GetArray();</font></pre>
+<p><font><b>FetchObject<a name="fetchobject"></a>($toupper=true)</b></font></p>
+<p><font>Returns the current row as an object. If you set $toupper
+    to true, then the object fields are set to upper-case. Note: The newer FetchNextObject()
+  is the recommended way of accessing rows as objects. See below.</font></p>
+<p><font><b>FetchNextObject<a name="fetchnextobject"></a>($toupper=true)</b></font></p>
+<p><font>Gets the current row as an object and moves to the next
+    row automatically. Returns false if at end-of-file. If you set $toupper to
+  true, then the object fields are set to upper-case.</font></p>
+<pre><font>$rs = $db-&gt;Execute('select firstname,lastname from table');<br>if ($rs) {<br>	while ($o = $rs-&gt;FetchNextObject()) {<br>		print "$o-&gt;FIRSTNAME, $o-&gt;LASTNAME&lt;BR&gt;";<br>	}<br>}<br></font></pre>
+<p><font>There is some trade-off in speed in using FetchNextObject().
+If performance is important, you should access rows with the <code>fields[]</code> array. <b>FetchObj<a name="fetchobj" id="fetchobj"></a>()</b> </font></p>
+<p><font>Returns the current record as an object. Fields are
+    not upper-cased, unlike FetchObject.  
+</font></p>
+<p><font><b>FetchNextObj<a name="fetchnextobj" id="fetchnextobj"></a>()</b> </font></p>
+<p><font>Returns the current record as an object and moves to
+    the next record. If EOF, false is returned. Fields are not upper-cased, unlike
+  FetctNextObject. </font></p>
+<font>
 <p><b>CurrentRow<a name="currentrow"></a>( )</b></p>
 <p>Returns the current row of the record set. 0 is the first row.</p>
 <p><b>AbsolutePosition<a name="abspos"></a>( )</b></p>
-<p>Synonym for <b>CurrentRow</b> for compatibility with ADO. Returns the current 
+<p>Synonym for <b>CurrentRow</b> for compatibility with ADO. Returns the current
   row of the record set. 0 is the first row.</p>
 <p><b>MetaType<a name="metatype"></a>($nativeDBType[,$field_max_length],[$fieldobj])</b></p>
-<p>Determine what <i>generic</i> meta type a database field type is given its 
-  native type $<b>nativeDBType</b> as a string and the length of the field $<b>field_max_length</b>. 
-  Note that field_max_length can be -1 if it is not known. The field object returned 
-  by FetchField() can be passed in $<b>fieldobj</b> or as the 1st parameter <b>$nativeDBType</b>. 
-  This is useful for databases such as <i>mysql</i> which has additional properties 
+<p>Determine what <i>generic</i> meta type a database field type is given its
+  native type $<b>nativeDBType</b> as a string and the length of the field $<b>field_max_length</b>.
+  Note that field_max_length can be -1 if it is not known. The field object returned
+  by FetchField() can be passed in $<b>fieldobj</b> or as the 1st parameter <b>$nativeDBType</b>.
+  This is useful for databases such as <i>mysql</i> which has additional properties
   in the field object such as <i>primary_key</i>. </p>
-<p>Uses the field <b>blobSize</b> and compares it with $<b>field_max_length</b> 
-  to determine whether the character field is actually a blob.</p>
-For example, $db-&gt;MetaType('char') will return 'C'. 
+<p>Uses the field <b>blobSize</b> and compares it with $<b>field_max_length</b> to
+  determine whether the character field is actually a blob.</p>
+For example, $db-&gt;MetaType('char') will return 'C'.
 <p>Returns:</p>
 <ul>
-  <li><b>C</b>: Character fields that should be shown in a &lt;input type="text"&gt; 
-    tag. </li>
-  <li><b>X</b>: Clob (character large objects), or large text fields that should 
+  <li><b>C</b>: Character fields that should be shown in a &lt;input type="text"&gt; tag. </li>
+  <li><b>X</b>: Clob (character large objects), or large text fields that should
     be shown in a &lt;textarea&gt;</li>
   <li><b>D</b>: Date field</li>
   <li><b>T</b>: Timestamp field</li>
   <li><b>L</b>: Logical field (boolean or bit-field)</li>
-  <li><b>N</b>: Numeric field. Includes decimal, numeric, floating point, and 
+  <li><b>N</b>: Numeric field. Includes decimal, numeric, floating point, and
     real. </li>
   <li><b>I</b>:&nbsp; Integer field. </li>
   <li><b>R</b>: Counter or Autoincrement field. Must be numeric.</li>
-  <li><b>B</b>: Blob, or binary large objects.<font color="#000000"> </font></li>
-</ul>
-</font> 
-</font><p><font color="#000000"><font color="#000000"> Since ADOdb 3.0, MetaType accepts $fieldobj as the first 
-  parameter, instead of $nativeDBType. </font></font></p>
-<font color="#000000"><font color="#000000"> 
-
-</font></font><p><font color="#000000"><font color="#000000"><b>Close( )<a name="rsclose"></a></b></font></font></p>
-<p><font color="#000000"><font color="#000000">Closes the recordset, cleaning all memory and resources associated with the recordset. 
-</font></font></p><p>
-<font color="#000000"><font color="#000000">If memory management is not an issue, you do not need to call this function as recordsets
-are closed for you by PHP at the end of the script. 
-SQL statements such as INSERT/UPDATE/DELETE do not really return a recordset, so you do not have to call Close()
-for such SQL statements.</font></font></p>
+  <li><b>B</b>: Blob, or binary large objects. </li>
+</ul> 
+</font><p><font> Since ADOdb 3.0, MetaType accepts $fieldobj
+    as the first parameter, instead of $nativeDBType. </font></p>
+<font> </font>
+<p><font><b>Close( )<a name="rsclose"></a></b></font></p>
+<p><font>Closes the recordset, cleaning all memory and resources
+associated with the recordset. </font></p>
+<p>
+<font>If memory management is not an issue, you do not need to
+call this function as recordsets are closed for you by PHP at the end of the
+script. SQL statements such as INSERT/UPDATE/DELETE do not really return a recordset,
+so you do not have to call Close() for such SQL statements.</font></p>
 <hr>
-<h3><font color="#000000"><font color="#000000">function rs2html<a name="rs2html"></a>($adorecordset,[$tableheader_attributes], 
-  [$col_titles])</font></font></h3>
-<p><font color="#000000"><font color="#000000">This is a standalone function (rs2html = recordset to html) that is similar 
-  to PHP's <i>odbc_result_all</i> function, it prints a ADORecordSet, $<b>adorecordset</b> 
-  as a HTML table. $<b>tableheader_attributes</b> allow you to control the table 
-  <i>cellpadding</i>, <i>cellspacing</i> and <i>border</i> attributes. Lastly 
-  you can replace the database column names with your own column titles with the 
-  array $<b>col_titles</b>. This is designed more as a quick debugging mechanism, 
-  not a production table recordset viewer.</font></font></p>
-<p><font color="#000000"><font color="#000000">You will need to include the file <i>tohtml.inc.php</i>.</font></font></p>
-<p><font color="#000000"><font color="#000000">Example of rs2html:<b><font color="#336600"><a name="exrs2html"></a></font></b></font></font></p>
-<pre><font color="#000000"><font color="#000000"><b><font color="#336600">&lt;?<br>include('tohtml.inc.php')</font></b>; # load code common to ADOdb <br><b>include</b>('adodb.inc.php'); # load code common to ADOdb <br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');   # create a connection <br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers'; <br>$<font color="#663300">rs</font>   = $<font color="#663300">conn</font>-&gt;Execute($sql); <br><font color="#336600"><b>rs2html</b></font><b>($<font color="#663300">rs</font>,'<i>border=2 cellpadding=3</i>',array('<i>Customer Name','Customer ID</i>'));<br>?&gt;</b></font></font></pre>
+<h3><font>function rs2html<a name="rs2html"></a>($adorecordset,[$tableheader_attributes],
+  [$col_titles])</font></h3>
+<p><font>This is a standalone function (rs2html = recordset to
+    html) that is similar to PHP's <i>odbc_result_all</i> function, it prints
+    a ADORecordSet, $<b>adorecordset</b> as a HTML table. $<b>tableheader_attributes</b> allow
+    you to control the table <i>cellpadding</i>, <i>cellspacing</i> and <i>border</i> attributes.
+    Lastly you can replace the database column names with your own column titles
+    with the array $<b>col_titles</b>. This is designed more as a quick debugging
+  mechanism, not a production table recordset viewer.</font></p>
+<p><font>You will need to include the file <i>tohtml.inc.php</i>.</font></p>
+<p><font>Example of rs2html:<b><font color="#336600"><a name="exrs2html"></a></font></b></font></p>
+<pre><font><b><font color="#336600">&lt;?<br>include('tohtml.inc.php')</font></b>; # load code common to ADOdb <br><b>include</b>('adodb.inc.php'); # load code common to ADOdb <br>$<font color="#663300">conn</font> = &amp;ADONewConnection('mysql');   # create a connection <br>$<font color="#663300">conn</font>-&gt;PConnect('localhost','userid','','agora');# connect to MySQL, agora db<br>$<font color="#663300">sql</font> = 'select CustomerName, CustomerID from customers'; <br>$<font color="#663300">rs</font>   = $<font color="#663300">conn</font>-&gt;Execute($sql); <br><font color="#336600"><b>rs2html</b></font><b>($<font color="#663300">rs</font>,'<i>border=2 cellpadding=3</i>',array('<i>Customer Name','Customer ID</i>'));<br>?&gt;</b></font></pre>
 <hr>
-<h3><font color="#000000"><font color="#000000">Differences between this ADOdb library and Microsoft ADO<a name="adodiff"></a></font></font></h3>
+<h3><font>Differences between this ADOdb library and Microsoft
+ADO<a name="adodiff"></a></font></h3>
 <ol>
-<font color="#000000"><font color="#000000">  <li>ADOdb only supports recordsets created by a connection object. Recordsets 
-    cannot be created independently.</li>
-  <li>ADO properties are implemented as functions in ADOdb. This makes it easier 
-    to implement any enhanced ADO functionality in the future.</li>
-  <li>ADOdb's <font face="Courier New, Courier, mono">ADORecordSet-&gt;Move()</font> 
-    uses absolute positioning, not relative. Bookmarks are not supported.</li>
-  <li><font face="Courier New, Courier, mono">ADORecordSet-&gt;AbsolutePosition() 
-    </font>cannot be used to move the record cursor.</li>
-  <li>ADO Parameter objects are not supported. Instead we have the ADOConnection::<a href="#parameter">Parameter</a>( 
-    ) function, which provides a simpler interface for calling preparing parameters 
-    and calling stored procedures.</li>
-  <li>Recordset properties for paging records are available, but implemented as 
-    in <a href="#ex8">Example 8</a>.</li>
-</font></font></ol>
+<font>
+<li>ADOdb only supports recordsets created by a connection object. Recordsets
+  cannot be created independently.</li>
+<li>ADO properties are implemented as functions in ADOdb. This makes it easier
+  to implement any enhanced ADO functionality in the future.</li>
+<li>ADOdb's <font face="Courier New, Courier, mono">ADORecordSet-&gt;Move()</font> uses
+  absolute positioning, not relative. Bookmarks are not supported.</li>
+<li><font face="Courier New, Courier, mono">ADORecordSet-&gt;AbsolutePosition() </font>cannot
+  be used to move the record cursor.</li>
+<li>ADO Parameter objects are not supported. Instead we have the ADOConnection::<a href="#parameter">Parameter</a>(
+  ) function, which provides a simpler interface for calling preparing parameters
+  and calling stored procedures.</li>
+<li>Recordset properties for paging records are available, but implemented as
+  in <a href="#ex8">Example 8</a>.</li>
+</font></ol>
 <hr>
-<h1><font color="#000000"><font color="#000000">Database Driver Guide<a name="driverguide"></a></font></font></h1>
-<p><font color="#000000"><font color="#000000">This describes how to create a class to connect to a new database. To ensure 
-  there is no duplication of work, kindly email me at jlim#natsoft.com.my if you 
-  decide to create such a class.</font></font></p>
-<p><font color="#000000"><font color="#000000">First decide on a name in lower case to call the database type. Let's say we 
-  call it xbase. </font></font></p>
-<p><font color="#000000"><font color="#000000">Then we need to create two classes ADODB_xbase and ADORecordSet_xbase in the 
-  file adodb-xbase.inc.php.</font></font></p>
-<p><font color="#000000"><font color="#000000">The simplest form of database driver is an adaptation of an existing ODBC driver. 
-  Then we just need to create the class <i>ADODB_xbase extends ADODB_odbc</i> 
-  to support the new <b>date</b> and <b>timestamp</b> formats, the <b>concatenation</b> 
-  operator used, <b>true</b> and <b>false</b>. For the<i> ADORecordSet_xbase extends 
-  ADORecordSet_odbc </i>we need to change the <b>MetaType</b> function. See<b> 
-  adodb-vfp.inc.php</b> as an example.</font></font></p>
-<p><font color="#000000"><font color="#000000">More complicated is a totally new database driver that connects to a new PHP 
-  extension. Then you will need to implement several functions. Fortunately, you 
-  do not have to modify most of the complex code. You only need to override a 
-  few stub functions. See <b>adodb-mysql.inc.php</b> for example.</font></font></p>
-<p><font color="#000000"><font color="#000000">The default date format of ADOdb internally is YYYY-MM-DD (Ansi-92). All dates 
-  should be converted to that format when passing to an ADOdb date function. See 
-  Oracle for an example how we use ALTER SESSION to change the default date format 
-  in _pconnect _connect.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADOConnection Functions to Override</b></font></font></p>
-<p><font color="#000000"><font color="#000000">Defining a constructor for your ADOConnection derived function is optional. 
-  There is no need to call the base class constructor.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>connect</b>: Low level implementation of Connect. Returns true or false. 
-  Should set the _<b>connectionID</b>.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>pconnect:</b> Low level implemention of PConnect. Returns true or false. 
-  Should set the _<b>connectionID</b>.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>query</b>: Execute a query. Returns the queryID, or false.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>close: </b>Close the connection -- PHP should clean up all recordsets. 
-</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ErrorMsg</b>: Stores the error message in the private variable _errorMsg. 
-</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADOConnection Fields to Set</b></font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>bindInputArray</b>: Set to true if binding of parameters for SQL inserts 
-  and updates is allowed using ?, eg. as with ODBC.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>fmtDate</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>fmtTimeStamp</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>true</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>false</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>concat_operator</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>replaceQuote</b></font></font></p>
-<p><font color="#000000"><font color="#000000"><b>hasLimit</b> support SELECT * FROM TABLE LIMIT 10 of MySQL.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>hasTop</b> support Microsoft style SELECT TOP 10 * FROM TABLE.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADORecordSet Functions to Override</b></font></font></p>
-<p><font color="#000000"><font color="#000000">You will need to define a constructor for your ADORecordSet derived class that 
-  calls the parent class constructor.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>FetchField: </b> as documented above in ADORecordSet</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>initrs</b>: low level initialization of the recordset: setup the _<b>numOfRows</b> 
-  and _<b>numOfFields</b> fields -- called by the constructor.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>seek</b>: seek to a particular row. Do not load the data into the fields 
-  array. This is done by _fetch. Returns true or false. Note that some implementations 
-  such as Interbase do not support seek. Set canSeek to false.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>fetch</b>: fetch a row using the database extension function and then move 
-  to the next row. Sets the <b>fields</b> array. If the parameter $ignore_fields 
-  is true then there is no need to populate the <b>fields</b> array, just move 
-  to the next row. then Returns true or false.</font></font></p>
-<p><font color="#000000"><font color="#000000">_<b>close</b>: close the recordset</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>Fields</b>: If the array row returned by the PHP extension is not an associative 
-  one, you will have to override this. See adodb-odbc.inc.php for an example. 
-  For databases such as MySQL and MSSQL where an associative array is returned, 
-  there is no need to override this function.</font></font></p>
-<p><font color="#000000"><font color="#000000"><b>ADOConnection Fields to Set</b></font></font></p>
-<p><font color="#000000"><font color="#000000">canSeek: Set to true if the _seek function works.</font></font></p>
-<h2><font color="#000000"><font color="#000000">ToDo:</font></font></h2>
-<p><font color="#000000"><font color="#000000">See the <a href="http://php.weblogs.com/adodb-todo-roadmap">RoadMap</a> article.</font></font></p>
-<p><font color="#000000"><font color="#000000">Also see the ADOdb <a href="http://php.weblogs.com/adodb_csv">proxy</a> article 
-  for bridging Windows and Unix databases using http remote procedure calls. For 
-  your education, visit <a href="http://palslib.com/">palslib.com</a> for database info, 
-  and read this article on <a href="http://phplens.com/lens/php-book/optimizing-debugging-php.php">Optimizing 
-  PHP</a>. </font></font></p>
+<h1><font>Database Driver Guide<a name="driverguide"></a></font></h1>
+<p><font>This describes how to create a class to connect to a
+    new database. To ensure there is no duplication of work, kindly email me
+  at jlim#natsoft.com.my if you decide to create such a class.</font></p>
+<p><font>First decide on a name in lower case to call the database
+  type. Let's say we call it xbase. </font></p>
+<p><font>Then we need to create two classes ADODB_xbase and ADORecordSet_xbase
+  in the file adodb-xbase.inc.php.</font></p>
+<p><font>The simplest form of database driver is an adaptation
+    of an existing ODBC driver. Then we just need to create the class <i>ADODB_xbase
+    extends ADODB_odbc</i> to support the new <b>date</b> and <b>timestamp</b> formats,
+    the <b>concatenation</b> operator used, <b>true</b> and <b>false</b>. For
+    the<i> ADORecordSet_xbase extends ADORecordSet_odbc </i>we need to change
+  the <b>MetaType</b> function. See<b> adodb-vfp.inc.php</b> as an example.</font></p>
+<p><font>More complicated is a totally new database driver that
+    connects to a new PHP extension. Then you will need to implement several
+    functions. Fortunately, you do not have to modify most of the complex code.
+    You only need to override a few stub functions. See <b>adodb-mysql.inc.php</b> for
+  example.</font></p>
+<p><font>The default date format of ADOdb internally is YYYY-MM-DD
+    (Ansi-92). All dates should be converted to that format when passing to an
+    ADOdb date function. See Oracle for an example how we use ALTER SESSION to
+  change the default date format in _pconnect _connect.</font></p>
+<p><font><b>ADOConnection Functions to Override</b></font></p>
+<p><font>Defining a constructor for your ADOConnection derived
+  function is optional. There is no need to call the base class constructor.</font></p>
+<p><font>_<b>connect</b>: Low level implementation of Connect.
+  Returns true or false. Should set the _<b>connectionID</b>.</font></p>
+<p><font>_<b>pconnect:</b> Low level implemention of PConnect.
+  Returns true or false. Should set the _<b>connectionID</b>.</font></p>
+<p><font>_<b>query</b>: Execute a query. Returns the queryID,
+or false.</font></p>
+<p><font>_<b>close: </b>Close the connection -- PHP should clean
+up all recordsets. </font></p>
+<p><font><b>ErrorMsg</b>: Stores the error message in the private
+variable _errorMsg. </font></p>
+<p><font><b>ADOConnection Fields to Set</b></font></p>
+<p><font>_<b>bindInputArray</b>: Set to true if binding of parameters
+  for SQL inserts and updates is allowed using ?, eg. as with ODBC.</font></p>
+<p><font><b>fmtDate</b></font></p>
+<p><font><b>fmtTimeStamp</b></font></p>
+<p><font><b>true</b></font></p>
+<p><font><b>false</b></font></p>
+<p><font><b>concat_operator</b></font></p>
+<p><font><b>replaceQuote</b></font></p>
+<p><font><b>hasLimit</b> support SELECT * FROM TABLE LIMIT 10
+of MySQL.</font></p>
+<p><font><b>hasTop</b> support Microsoft style SELECT TOP 10
+* FROM TABLE.</font></p>
+<p><font><b>ADORecordSet Functions to Override</b></font></p>
+<p><font>You will need to define a constructor for your ADORecordSet
+  derived class that calls the parent class constructor.</font></p>
+<p><font><b>FetchField: </b> as documented above in ADORecordSet</font></p>
+<p><font>_<b>initrs</b>: low level initialization of the recordset:
+    setup the _<b>numOfRows</b> and _<b>numOfFields</b> fields -- called by the
+  constructor.</font></p>
+<p><font>_<b>seek</b>: seek to a particular row. Do not load
+    the data into the fields array. This is done by _fetch. Returns true or false.
+    Note that some implementations such as Interbase do not support seek. Set
+  canSeek to false.</font></p>
+<p><font>_<b>fetch</b>: fetch a row using the database extension
+    function and then move to the next row. Sets the <b>fields</b> array. If
+    the parameter $ignore_fields is true then there is no need to populate the <b>fields</b> array,
+  just move to the next row. then Returns true or false.</font></p>
+<p><font>_<b>close</b>: close the recordset</font></p>
+<p><font><b>Fields</b>: If the array row returned by the PHP
+    extension is not an associative one, you will have to override this. See
+    adodb-odbc.inc.php for an example. For databases such as MySQL and MSSQL
+    where an associative array is returned, there is no need to override this
+  function.</font></p>
+<p><font><b>ADOConnection Fields to Set</b></font></p>
+<p><font>canSeek: Set to true if the _seek function works.</font></p>
+<h2><font>ToDo:</font></h2>
+<p><font>See the <a href="http://php.weblogs.com/adodb-todo-roadmap">RoadMap</a> article.</font></p>
+<p><font>Also see the ADOdb <a href="http://php.weblogs.com/adodb_csv">proxy</a> article
+    for bridging Windows and Unix databases using http remote procedure calls.
+    For your education, visit <a href="http://palslib.com/">palslib.com</a> for
+    database info, and read this article on <a href="http://phplens.com/lens/php-book/optimizing-debugging-php.php">Optimizing
+  PHP</a>. </font></p>
 
-<h2><font color="#000000">Change Log<a name="Changes"></a><a name="changes"></a><a name="changelog"></a></font></h2>
-<p><a name="4.54"></a><b>4.54 5 Nov 2004</b>
-<p>
-Now you can set $db->charSet = ?? before doing a Connect() in oci8.
-<p>
+<h2><font>Change Log<a name="Changes"></a><a name="changes"></a><a name="changelog"></a></font></h2>
+<p><a name="4.62"></a><b>4.62  2 Apr 2005</b>
+<p>Added 'w' (dow as 0-6 or 1-7) and 'l' (dow as string) for SQLDate for oci8, postgres and mysql.
+<p>Rolled back MetaType() changes for mysqli done in prev version.
+<p>Datadict change by chris, cblin#tennaxia.com data mappings from:
+<pre>
+oci8:  X->varchar(4000) XL->CLOB
+mssql: X->XL->TEXT
+mysql: X->XL->LONGTEXT
+fbird: X->XL->varchar(4000)
+</pre>
+<p>to:
+<pre>
+oci8:  X->varchar(4000) XL->CLOB
+mssql: X->VARCHAR(4000) XL->TEXT
+mysql: X->TEXT          XL->LONGTEXT
+fbird: X->VARCHAR(4000) XL->VARCHAR(32000)
+</pre>
+<p>Added $connection->disableBlobs to postgresql to improve performance when no bytea is used (2-5% improvement).
+<p>Removed all HTTP_* vars.
+<p>Added $rs->tableName to be set before calling AutoExecute().
+<p>Alex Rootoff rootoff#pisem.net contributed ukrainian language file.
+<p>Added new mysql_option() support using $conn->optionFlags array.
+<p>Added support for ldap_set_option() using the $LDAP_CONNECT_OPTIONS global variable. Contributed by Josh Eldridge.
+<p>Added LDAP_* constant definitions to ldap.
+<p>Added support for boolean bind variables. We use $conn->false and $conn->true to hold values to set false/true to.
+<p>We now do not close the session connection in adodb-session.inc.php as other objects could be using this connection.
+<p>We now strip off \0 at end of Ixora SQL strings in $perf->tohtml() for oci8.
+<p><a name="4.61"></a><b>4.61 23 Feb 2005</b>
+<p>MySQLi added support for mysqli_connect_errno() and mysqli_connect_error().
+<p>Massive improvements to alpha PDO driver.
+<p>Quote string bind parameters logged by performance monitor for easy type checking. Thx Jason Judge.
+<p>Added support for $role when connecting with Interbase/firebird.
+<p>Added support for enum recognition in MetaColumns() mysql and mysqli. Thx Amedeo Petrella.
+<p>The sybase_ase driver contributed by Interakt Online. Thx Cristian Marin cristic#interaktonline.com.
+<p>Removed not_null, has_default, and default_value from ADOFieldObject.
+<p>Sessions code, fixed quoting of keys when handling LOBs in session write() function.
+<p>Sessions code, added adodb_session_regenerate_id(), to reduce risk of session hijacking by changing session cookie dynamically. Thx Joe Li.
+<p>Perf monitor, polling for CPU did not work for PHP 4.3.10 and 5.0.0-5.0.3 due to PHP bugs, so we special case these versions.
+<p>Postgresql, UpdateBlob() added code to handle type==CLOB.
+<p><a name="4.60"></a><b>4.60 24 Jan 2005</b>
+<p>Implemented PEAR DB's autoExecute(). Simplified design because I don't like using constants when
+strings work fine.
+<p>_rs2serialize will now update $rs->sql and $rs->oldProvider.
+<p>Added autoExecute().
+<p>Added support for postgres8 driver. Currently just remapped to postgres7 driver.
+<p>Changed oci8 _query(), so that OCIBindByName() sets the length to -1 if element size is > 4000. This provides better support
+for LONGs.
+<p>Added SetDateLocale() support for netherlands (Nl).
+<p>Spelling error in pivot code ($iff should be $iif).
+</p><p>mysql insert_id() did not work with mysql 3.x. Fixed.
+</p><p>"\r\n" not converted to spaces correctly in exporting data. Fixed.
+</p><p>_nconnect() in mysqli did not return value correctly. Fixed.
+</p><p>Arne Eckmann contributed danish language file.
+</p><p>Added clone() support to FetchObject() for PHP5.<br>
+</p>
+<p>Removed SQL_CUR_USE_ODBC from odbc_mssql.<br>
+</p>
+<p><a name="4.55"></a><b>4.55 5 Jan 2005</b>
+</p><p>Found bug in Execute() with bind params for db's that do not support binding natively.
+</p><p>DropSequence() now correctly uses default parameter.
+</p><p>Now Execute() ignores locale for floats, so 1.23 is NEVER converted to 1,23.
+</p><p>SetFetchMode() not properly saved in adodb-perf, suspicious sql and expensive sql. Fixed.
+</p><p>Added INET to postgresql metatypes. Thx motzel.
+</p><p>Allow oracle hints to work when counting with _adodb_getcount in adodb-lib.inc.php. Thx Chris Wrye.
+</p><p>Changed mysql insert_id() to use SELECT LAST_INSERT_ID().
+</p><p>If alter col in datadict does not modify col type/size of actual
+col, then it is removed from alter col code. By Mark Newham. Not
+perfect as MetaType() !== ActualType().
+</p><p>Added handling of view fields in metacolumns() for postgresql. Thx Renato De Giovanni.
+</p><p>Added to informix MetaPrimaryKeys and MetaColumns fixes for null bit. Thx to Cecilio Albero.
+</p><p>Removed obsolete connection_timeout() from perf code.
+</p><p>Added support for arrayClass in adodb-csv.inc.php.
+</p><p>RSFilter now accepts methods of the form $array($obj, 'methodname'). Thx to blake#near-time.com.
+</p><p>Changed CacheFlush to $cmd = 'rm -rf '.$ADODB_CACHE_DIR.'/[0-9a-f][0-9a-f]/'; 
+</p><p>For better cursor concurrency, added code to free ref cursors in
+oci8 when $rs-&gt;Close() is called. Note that CLose() is called
+internally by the Get* functions too.
+</p><p>Added IIF support for access when pivoting.  Thx Volodia Krupach.
+</p><p>Added mssql datadict support for timestamp. Thx Alexios.
+</p><p>Informix pager fix. By Mario Ramirez.
+</p><p>ADODB_TABLE_REGEX now includes ':'. By Mario Ramirez.
+</p><p>Mark Newnham contributed MetaIndexes for oci8 and db2.
+</p><p><a name="4.54"></a><b>4.54 5 Nov 2004</b>
+</p><p>
+Now you can set $db-&gt;charSet = ?? before doing a Connect() in oci8.
+</p><p>
 Added adodbFetchMode to sqlite.
-<p>
+</p><p>
 Perf code, added a string typecast to substr in adodb_log_sql().
-<p>
+</p><p>
 Postgres: Changed BlobDecode() to use po_loread, added new $maxblobsize parameter, and now it returns the blob instead
 of sending it to stdout - make sure to mention that as a compat warning.
-Also added $db->IsOID($oid) function; uses a heuristic, not guaranteed to work 100%.
-<p>
+Also added $db-&gt;IsOID($oid) function; uses a heuristic, not guaranteed to work 100%.
+</p><p>
 Contributed arabic language file by "El-Shamaa, Khaled" k.el-shamaa#cgiar.org
-<p>
+</p><p>
 PHP5 exceptions did not handle @ protocol properly. Fixed.
-<p>
+</p><p>
 Added ifnull handling for postgresql (using coalesce).
-<p>
+</p><p>
 Added  metatables() support for Postgresql 8.0 (no longer uses pg_% dictionary tables).
-<p>
+</p><p>
 Improved Sybase ErrorMsg() function. By Gaetano Giunta.
-<p>
+</p><p>
 Improved oci8 SelectLimit() to use Prepare(). By Cristiano Duarte.
-<P>
+</p><p>
 Type-cast $row parameter in ifx_fetch_row() to int. Thx stefan bodgan.
-<p>Ralf becker contributed improvements in postgresql, sapdb, mysql data dictionary handling:<br>
+</p><p>Ralf becker contributed improvements in postgresql, sapdb, mysql data dictionary handling:<br>
 - MySql and Postgres MetaType was reporting every int column which was 
 part of a primary key and unique as serial<br>
 - Postgres was not reporting the scale of decimal types<br>
 - MaxDB was padding the defaults of none-string types with spaces<br>
 - MySql now correctly converts enum columns to varchar
-<p>
+</p><p>
 Ralf also changed Postgresql datadict:<br>
 - you cant add NOT NULL columns in postgres in one go, they need to be 
 added as NULL and then altered to NOT NULL<br>
@@ -2701,418 +2936,299 @@
 - a re-created sequence was not set to the correct value, if the name 
 was the old name (no implicit sequence), now always the new name of the 
 implicit sequence is used<br>
-<p>Sergio Strampelli added extra $intoken check to Lens_ParseArgs() in datadict code.
-<p><a name="4.53"></a><b>4.53 28 Sept 2004</b>
-</p><p><font color="#000000">FetchMode cached in recordset is sometimes mapped to native db fetchMode. Normally this does not matter,
+</p><p>Sergio Strampelli added extra $intoken check to Lens_ParseArgs() in datadict code.
+</p><p><a name="4.53"></a><b>4.53 28 Sept 2004</b>
+</p><p>FetchMode cached in recordset is sometimes mapped to native db fetchMode. Normally this does not matter,
 but when using cached recordsets, we need to switch back to using adodb fetchmode.  So we cache this
 in $rs-&gt;adodbFetchMode if it differs from the db's fetchMode.
-</font></p><p><font color="#000000">For informix we now set canSeek = false driver because stefan bodgan tells me that seeking doesn't work. 
-</font></p><p><font color="#000000">SetDateLocale() never worked till now ;-) Thx david#tomato.it
-</font></p><p><font color="#000000">Set $_bindInputArray = true in sapdb driver. Required for clob support.
-</font></p><p><font color="#000000">Fixed some PEAR::DB emulation issues with isError() and isWarning. Thx to Gert-Rainer Bitterlich.
-</font></p><p><font color="#000000">Empty() used in getupdatesql without strlen() check. Fixed.</font></p>
-<p><font color="#000000">Added unsigned detection to mysql and mysqli drivers. Thx to dan cech.
-</font></p><p><font color="#000000">Added hungarian language file. Thx to Hal&aacute;szv&aacute;ri G&aacute;bor.
-</font></p><p><font color="#000000">Improved fieldname-type formatting of datadict SQL generated (adding $widespacing parameter to _GenField).
-</font></p><p><font color="#000000">Datadict oci8 DROP CONSTRAINTS misspelt. Fixed. Thx Mark Newnham.
-</font></p><p><font color="#000000">Changed odbtp to dynamically change databaseType based on connection, eg. from 'odbtp' to 'odbtp_mssql' when connecting
+</p><p>For informix we now set canSeek = false driver because stefan bodgan tells me that seeking doesn't work. 
+</p><p>SetDateLocale() never worked till now ;-) Thx david#tomato.it
+</p><p>Set $_bindInputArray = true in sapdb driver. Required for clob support.
+</p><p>Fixed some PEAR::DB emulation issues with isError() and isWarning. Thx to Gert-Rainer Bitterlich.
+</p><p>Empty() used in getupdatesql without strlen() check. Fixed.</p>
+<p>Added unsigned detection to mysql and mysqli drivers. Thx to dan cech.
+</p><p>Added hungarian language file. Thx to Hal&aacute;szv&aacute;ri G&aacute;bor.
+</p><p>Improved fieldname-type formatting of datadict SQL generated (adding $widespacing parameter to _GenField).
+</p><p>Datadict oci8 DROP CONSTRAINTS misspelt. Fixed. Thx Mark Newnham.
+</p><p>Changed odbtp to dynamically change databaseType based on connection, eg. from 'odbtp' to 'odbtp_mssql' when connecting
 to mssql database.
-</font></p><p><font color="#000000">In datadict, MySQL I4 was wrongly mapped to MEDIUMINT, which is actually I3. Fixed.
-</font></p><p><font color="#000000">Fixed mysqli MetaType() recognition. Mysqli returns numeric types unlike mysql extension. Thx Francesco Riosa.
-</font></p><p><font color="#000000">VFP odbc driver curmode set wrongly, causing problems with memo fields. Fixed.
-</font></p><p><font color="#000000">Odbc driver did not recognize odbc version 2 driver date types properly. Fixed. Thx Bostjan.
-</font></p><p><font color="#000000">ChangeTableSQL() fixes to datadict-db2.inc.php by Mark Newnham.
-</font></p><p><font color="#000000">Perf monitoring with odbc improved. Now we try in perf code to manually set the sysTimeStamp using date() if sysTimeStamp
+</p><p>In datadict, MySQL I4 was wrongly mapped to MEDIUMINT, which is actually I3. Fixed.
+</p><p>Fixed mysqli MetaType() recognition. Mysqli returns numeric types unlike mysql extension. Thx Francesco Riosa.
+</p><p>VFP odbc driver curmode set wrongly, causing problems with memo fields. Fixed.
+</p><p>Odbc driver did not recognize odbc version 2 driver date types properly. Fixed. Thx Bostjan.
+</p><p>ChangeTableSQL() fixes to datadict-db2.inc.php by Mark Newnham.
+</p><p>Perf monitoring with odbc improved. Now we try in perf code to manually set the sysTimeStamp using date() if sysTimeStamp
 is empty.
-</font></p><p><font color="#000000">All ADO errors are thrown as exceptions in PHP5. 
+</p><p>All ADO errors are thrown as exceptions in PHP5. 
 So we added exception handling to ado in PHP5 by creating new adodb-ado5.inc.php driver.
-</font></p><p><font color="#000000">Added IsConnected(). Returns true if connection object connected. By Luca.Gioppo.
-</font></p><p><font color="#000000">"Ralf Becker"
+</p><p>Added IsConnected(). Returns true if connection object connected. By Luca.Gioppo.
+</p><p>"Ralf Becker"
 RalfBecker#digitalROCK.de contributed new sapdb data-dictionary driver
 and a large patch that implements field and table renaming for oracle,
 mssql, postgresql, mysql and sapdb. See the new RenameTableSQL() and
 RenameColumnSQL() functions.
-</font></p><p><font color="#000000">We now check ExecuteCursor to see if PrepareSP was initially called.
-</font></p><p><font color="#000000">Changed oci8 datadict to use MODIFY for $dd-&gt;alterCol. Thx Mark Newnham.
-</font></p><p><font color="#000000"><a name="4.52"></a><b>4.52  10 Aug 2004</b>
-</font></p><p><font color="#000000">Bug found in Replace() when performance logging enabled, introduced in ADOdb 4.50. Fixed.
-</font></p><p><font color="#000000">Replace() checks update stmt. If update stmt fails, we now return immediately. Thx to alex.
-</font></p><p><font color="#000000">Added support for $ADODB_FORCE_TYPE in GetUpdateSQL/GetInsertSQL. Thx to niko.
-</font></p><p><font color="#000000">Added ADODB_ASSOC_CASE support to postgres/postgres7 driver.
-</font></p><p><font color="#000000">Support for DECLARE stmt in oci8. Thx Lochbrunner.
-</font></p><p><font color="#000000"><a name="4.51"></a><b>4.51  29 July  2004</b>
-</font></p><p><font color="#000000">Added adodb-xmlschema 1.0.2. Thx dan and richard.
-</font></p><p><font color="#000000">Added new adorecordset_ext_* classes. If ADOdb extension installed for mysql, mysqlt and oci8 
+</p><p>We now check ExecuteCursor to see if PrepareSP was initially called.
+</p><p>Changed oci8 datadict to use MODIFY for $dd-&gt;alterCol. Thx Mark Newnham.
+</p><p><a name="4.52"></a><b>4.52  10 Aug 2004</b>
+</p><p>Bug found in Replace() when performance logging enabled, introduced in ADOdb 4.50. Fixed.
+</p><p>Replace() checks update stmt. If update stmt fails, we now return immediately. Thx to alex.
+</p><p>Added support for $ADODB_FORCE_TYPE in GetUpdateSQL/GetInsertSQL. Thx to niko.
+</p><p>Added ADODB_ASSOC_CASE support to postgres/postgres7 driver.
+</p><p>Support for DECLARE stmt in oci8. Thx Lochbrunner.
+</p><p><a name="4.51"></a><b>4.51  29 July  2004</b>
+</p><p>Added adodb-xmlschema 1.0.2. Thx dan and richard.
+</p><p>Added new adorecordset_ext_* classes. If ADOdb extension installed for mysql, mysqlt and oci8 
 (but not oci8po),  we use the superfast ADOdb extension code for movenext.
-</font></p><p><font color="#000000">Added schema support to mssql and odbc_mssql MetaPrimaryKeys().
-</font></p><p><font color="#000000">Patched MSSQL driver to support PHP NULL and Boolean values 
+</p><p>Added schema support to mssql and odbc_mssql MetaPrimaryKeys().
+</p><p>Patched MSSQL driver to support PHP NULL and Boolean values 
 while binding the input array parameters in the _query() function. By Stephen Farmer.
-</font></p><p><font color="#000000">Added support for clob's for mssql,  UpdateBlob(). Thx to gfran#directa.com.br
-</font></p><p><font color="#000000">Added normalize support for postgresql (true=lowercase table name, or false=case-sensitive table names) 
+</p><p>Added support for clob's for mssql,  UpdateBlob(). Thx to gfran#directa.com.br
+</p><p>Added normalize support for postgresql (true=lowercase table name, or false=case-sensitive table names) 
 to MetaColumns($table, $normalize=true).
-</font></p><p><font color="#000000">PHP5 variant dates in ADO not working. Fixed in adodb-ado.inc.php.
-</font></p><p><font color="#000000">Constant ADODB_FORCE_NULLS was not working properly for many releases (for GetUpdateSQL). Fixed. 
+</p><p>PHP5 variant dates in ADO not working. Fixed in adodb-ado.inc.php.
+</p><p>Constant ADODB_FORCE_NULLS was not working properly for many releases (for GetUpdateSQL). Fixed. 
 Also GetUpdateSQL strips off ORDER BY now - thx Elieser Le&atilde;o.
-</font></p><p><font color="#000000">Perf Monitor for oci8 now dynamically highlights optimizer_* params if too high/low.
-</font></p><p><font color="#000000">Added dsn support to NewADOConnection/ADONewConnection.
-</font></p><p><font color="#000000">Fixed out of page bounds bug in _adodb_pageexecute_all_rows() Thx to "Sergio Strampelli" sergio#rir.it
-</font></p><p><font color="#000000">Speedup of movenext for mysql and oci8 drivers.
-</font></p><p><font color="#000000">Moved debugging code _adodb_debug_execute() to adodb-lib.inc.php.
-</font></p><p><font color="#000000">Fixed postgresql bytea detection bug. See http://phplens.com/lens/lensforum/msgs.php?id=9849.
-</font></p><p><font color="#000000">Fixed ibase datetimestamp typo in PHP5. Thx stefan.
-</font></p><p><font color="#000000">Removed whitespace at end of odbtp drivers.
-</font></p><p><font color="#000000">Added db2 metaprimarykeys fix.
-</font></p><p><font color="#000000">Optimizations to MoveNext() for mysql and oci8. Misc speedups to Get* functions.
-</font></p><p><font color="#000000"><a name="4.50"></a><b>4.50  6 July  2004</b>
-</font></p><p><font color="#000000">Bumped it to 4.50 to avoid confusion with PHP 4.3.x series.
-</font></p><p><font color="#000000">Added db2 metatables and metacolumns extensions.
-</font></p><p><font color="#000000">Added alpha PDO driver. Very buggy, only works with odbc.
-</font></p><p><font color="#000000">Tested mysqli. Set poorAffectedRows = true. Cleaned up movenext() and _fetch().
-</font></p><p><font color="#000000">PageExecute does not work properly with php5 (return val not a variable). Reported Dmytro Sychevsky sych#php.com.ua.  Fixed.
-</font></p><p><font color="#000000">MetaTables() for mysql, $showschema parameter was not backward compatible with older versions of adodb. Fixed.
-</font></p><p><font color="#000000">Changed mysql GetOne() to work with mysql 3.23 when using with non-select stmts (e.g. SHOW TABLES).
-</font></p><p><font color="#000000">Changed TRIG_ prefix to a variable in datadict-oci8.inc.php. Thx to Luca.Gioppo#csi.it.
-</font></p><p><font color="#000000">New to adodb-time code. We allow you to define your own daylights savings function, 
+</p><p>Perf Monitor for oci8 now dynamically highlights optimizer_* params if too high/low.
+</p><p>Added dsn support to NewADOConnection/ADONewConnection.
+</p><p>Fixed out of page bounds bug in _adodb_pageexecute_all_rows() Thx to "Sergio Strampelli" sergio#rir.it
+</p><p>Speedup of movenext for mysql and oci8 drivers.
+</p><p>Moved debugging code _adodb_debug_execute() to adodb-lib.inc.php.
+</p><p>Fixed postgresql bytea detection bug. See http://phplens.com/lens/lensforum/msgs.php?id=9849.
+</p><p>Fixed ibase datetimestamp typo in PHP5. Thx stefan.
+</p><p>Removed whitespace at end of odbtp drivers.
+</p><p>Added db2 metaprimarykeys fix.
+</p><p>Optimizations to MoveNext() for mysql and oci8. Misc speedups to Get* functions.
+</p><p><a name="4.50"></a><b>4.50  6 July  2004</b>
+</p><p>Bumped it to 4.50 to avoid confusion with PHP 4.3.x series.
+</p><p>Added db2 metatables and metacolumns extensions.
+</p><p>Added alpha PDO driver. Very buggy, only works with odbc.
+</p><p>Tested mysqli. Set poorAffectedRows = true. Cleaned up movenext() and _fetch().
+</p><p>PageExecute does not work properly with php5 (return val not a variable). Reported Dmytro Sychevsky sych#php.com.ua.  Fixed.
+</p><p>MetaTables() for mysql, $showschema parameter was not backward compatible with older versions of adodb. Fixed.
+</p><p>Changed mysql GetOne() to work with mysql 3.23 when using with non-select stmts (e.g. SHOW TABLES).
+</p><p>Changed TRIG_ prefix to a variable in datadict-oci8.inc.php. Thx to Luca.Gioppo#csi.it.
+</p><p>New to adodb-time code. We allow you to define your own daylights savings function, 
 adodb_daylight_sv for pre-1970 dates. If the function is defined 
 (somewhere in an include), then you can correct 
 for daylights savings. See http://phplens.com/phpeverywhere/node/view/16#daylightsavings
 for more info.
-</font></p><p><font color="#000000">New sqlitepo driver. This is because assoc mode does not work like other drivers in sqlite.
+</p><p>New sqlitepo driver. This is because assoc mode does not work like other drivers in sqlite.
    Namely, when selecting (joining) multiple tables, in assoc mode the table
    	  names are included in the assoc keys in the "sqlite" driver.
 	  In "sqlitepo" driver, the table names are stripped from the returned column names. 
 	  When this results in a conflict,  the first field get preference.
 	Contributed by Herman Kuiper  herman#ozuzo.net  
-</font></p><p><font color="#000000">Added $forcenull parameter to GetInsertSQL/GetUpdateSQL. Idea by Marco Aurelio Silva.
-</font></p><p><font color="#000000">More XHTML changes for GetMenu. By Jeremy Evans.
-</font></p><p><font color="#000000">Fixes some ibase date issues. Thx to stefan bogdan.
-</font></p><p><font color="#000000">Improvements to mysqli driver to support $ADODB_COUNTRECS.
-</font></p><p><font color="#000000">Fixed adodb-csvlib.inc.php problem when reading stream from socket. We need to poll stream continiously.
-</font></p><p><font color="#000000"><a name="4.23"></a><b>4.23  16 June   2004</b>
-</font></p><p>
-<font color="#000000">New interbase/firebird fixes thx to Lester Caine.
+</p><p>Added $forcenull parameter to GetInsertSQL/GetUpdateSQL. Idea by Marco Aurelio Silva.
+</p><p>More XHTML changes for GetMenu. By Jeremy Evans.
+</p><p>Fixes some ibase date issues. Thx to stefan bogdan.
+</p><p>Improvements to mysqli driver to support $ADODB_COUNTRECS.
+</p><p>Fixed adodb-csvlib.inc.php problem when reading stream from socket. We need to poll stream continiously.
+</p><p><a name="4.23"></a><b>4.23  16 June   2004</b>
+</p><p>
+New interbase/firebird fixes thx to Lester Caine.
 Driver fixes a problem with getting field names in the result array, and 
 corrects a couple of data conversions. Also we default to dialect3 for firebird.
 Also ibase sysDate property was wrong. Changed to cast as timestamp.
-</font></p><p>
-<font color="#000000">The datadict driver is set up to give quoted tables and fields as this 
+</p><p>
+The datadict driver is set up to give quoted tables and fields as this 
 was the only way round reserved words being used as field names in 
 TikiWiki. TikiPro is tidying that up, and I hope to be able to produce a 
 build of THAT which uses what I consider proper UPPERCASE field and 
 table names. The conversion of TikiWiki to ADOdb helped in that, but 
 until the database is completely tidied up in TikiPro ...
-</font></p><p><font color="#000000">Modified _gencachename() to include fetchmode in name hash.
+</p><p>Modified _gencachename() to include fetchmode in name hash.
 This means you should clear your cache directory after installing this release as the 
 cache name algorithm has changed.
-</font></p><p><font color="#000000">Now Cache* functions work in safe
+</p><p>Now Cache* functions work in safe
 mode, because we do not create sub-directories in the $ADODB_CACHE_DIR
 in safe mode. In non-safe mode we still create sub-directories. Done by
 modifying _gencachename().
-</font></p><p><font color="#000000">Added $gmt parameter (true/false)
+</p><p>Added $gmt parameter (true/false)
 to UserDate and UserTimeStamp in connection class, to force conversion
 of input (in local time) to be converted to UTC/GMT.
-</font></p><p><font color="#000000">Mssql datadict did not support INT types properly (no size param allowed). 
+</p><p>Mssql datadict did not support INT types properly (no size param allowed). 
 Added _GetSize() to datadict-mssql.inc.php.
-</font></p><p><font color="#000000">For borland_ibase, BeginTrans(), changed:<br>
-</font></p><pre><font color="#000000">   $this-&gt;_transactionID = $this-&gt;_connectionID;</font></pre>
-<font color="#000000">to<br>
-</font><pre><font color="#000000">   $this-&gt;_transactionID = ibase_trans($this-&gt;ibasetrans, $this-&gt;_connectionID);</font></pre>
-<font color="#000000">		
-</font><p><font color="#000000">Fixed typo in mysqi_field_seek(). Thx to Sh4dow (sh4dow#php.pl).
-</font></p><p><font color="#000000">LogSQL did not work with Firebird/Interbase. Fixed.
-</font></p><p><font color="#000000">Postgres: made errorno() handling more consistent. Thx to Michael Jahn, Michael.Jahn#mailbox.tu-dresden.de.
-</font></p><p><font color="#000000">Added informix patch to better support metatables, metacolumns by "Cecilio Albero" c-albero#eos-i.com
-</font></p><p><font color="#000000">Cyril Malevanov contributed patch to oci8 to support passing of LOB parameters:
-</font></p><pre><font color="#000000">	$text = 'test test test';<br>	$sql = "declare rs clob; begin :rs := lobinout(:sa0); end;";<br>	$stmt = $conn -&gt; PrepareSP($sql);<br>	$conn -&gt; InParameter($stmt,$text,'sa0', -1, OCI_B_CLOB);<br>	$rs = '';<br>	$conn -&gt; OutParameter($stmt,$rs,'rs', -1, OCI_B_CLOB);<br>	$conn -&gt; Execute($stmt);<br>	echo "return = ".$rs."&lt;br&gt;";<br></font></pre>
-<font color="#000000">As he says, the LOBs limitations are:
-</font><pre><font color="#000000"> - use OCINewDescriptor before binding<br> - if Param is IN, uses save() before each execute. This is done automatically for you.<br> - if Param is OUT, uses load() after each execute. This is done automatically for you.<br> - when we bind $var as LOB, we create new descriptor and return it as a<br>   Bind Result, so if we want to use OUT parameters, we have to store<br>   somewhere &amp;$var to load() data from LOB to it.<br> - IN OUT params are not working now (should not be a big problem to fix it)<br> - now mass binding not working too (I've wrote about it before)<br></font></pre>
-<p><font color="#000000">Simplified Connect() and PConnect() error handling.
-</font></p><p><font color="#000000">When extension not loaded, Connect() and PConnect() will return null. On connect error, the fns will return false.
-</font></p><p><font color="#000000">CacheGetArray() added to code.
-</font></p><p><font color="#000000">Added Init() to adorecordset_empty().
-</font></p><p><font color="#000000">Changed postgres64 driver, MetaColumns() to not strip off quotes in default value if :: detected (type-casting of default).
-</font></p><p><font color="#000000">Added test: if (!defined('ADODB_DIR')) die(). Useful to prevent hackers from detecting file paths.
-</font></p><p><font color="#000000">Changed metaTablesSQL to ignore Postgres 7.4 information schemas (sql_*).
-</font></p><p><font color="#000000">New polish language file by  Grzegorz Pacan
-</font></p><p><font color="#000000">Added support for UNION in _adodb_getcount().
-</font></p><p><font color="#000000">Added security check for ADODB_DIR to limit path disclosure issues. Requested by postnuke team.
-</font></p><p><font color="#000000">Added better error message support to oracle driver. Thx to Gaetano Giunta.
-</font></p><p><font color="#000000">Added showSchema support to mysql.
-</font></p><p><font color="#000000">Bind in oci8 did not handle $name=false properly. Fixed.
-</font></p><p><font color="#000000">If extension not loaded, Connect(), PConnect(), NConnect() will return null.
-</font></p><p><font color="#000000"><b>4.22  15 Apr   2004</b>
-</font></p><p><font color="#000000">Moved docs to own adodb/docs folder.
-</font></p><p><font color="#000000">Fixed session bug when quoting compressed/encrypted data in Replace().
-</font></p><p><font color="#000000">Netezza Driver and LDAP drivers contributed by Josh Eldridge.
-</font></p><p><font color="#000000">GetMenu now uses rtrim() on values instead of trim().
-</font></p><p><font color="#000000">Changed MetaColumnNames to return an associative array, keys being the field names in uppercase.
-</font></p><p><font color="#000000">Suggested fix to adodb-ado.inc.php affected_rows to support PHP5 variants. Thx to Alexios Fakos.
-</font></p><p><font color="#000000">Contributed bulgarian language file by Valentin Sheiretsky valio#valio.eu.org.
-</font></p><p><font color="#000000">Contributed romanian language file by stefan bogdan.
-</font></p><p><font color="#000000">GetInsertSQL now checks for table name (string) in $rs, and will create a recordset for that
+</p><p>For borland_ibase, BeginTrans(), changed:<br>
+</p><pre>   $this-&gt;_transactionID = $this-&gt;_connectionID;</pre>
+to<br>
+<pre>   $this-&gt;_transactionID = ibase_trans($this-&gt;ibasetrans, $this-&gt;_connectionID);</pre>
+		
+<p>Fixed typo in mysqi_field_seek(). Thx to Sh4dow (sh4dow#php.pl).
+</p><p>LogSQL did not work with Firebird/Interbase. Fixed.
+</p><p>Postgres: made errorno() handling more consistent. Thx to Michael Jahn, Michael.Jahn#mailbox.tu-dresden.de.
+</p><p>Added informix patch to better support metatables, metacolumns by "Cecilio Albero" c-albero#eos-i.com
+</p><p>Cyril Malevanov contributed patch to oci8 to support passing of LOB parameters:
+</p><pre>	$text = 'test test test';<br>	$sql = "declare rs clob; begin :rs := lobinout(:sa0); end;";<br>	$stmt = $conn -&gt; PrepareSP($sql);<br>	$conn -&gt; InParameter($stmt,$text,'sa0', -1, OCI_B_CLOB);<br>	$rs = '';<br>	$conn -&gt; OutParameter($stmt,$rs,'rs', -1, OCI_B_CLOB);<br>	$conn -&gt; Execute($stmt);<br>	echo "return = ".$rs."&lt;br&gt;";<br></pre>
+As he says, the LOBs limitations are:
+<pre> - use OCINewDescriptor before binding<br> - if Param is IN, uses save() before each execute. This is done automatically for you.<br> - if Param is OUT, uses load() after each execute. This is done automatically for you.<br> - when we bind $var as LOB, we create new descriptor and return it as a<br>   Bind Result, so if we want to use OUT parameters, we have to store<br>   somewhere &amp;$var to load() data from LOB to it.<br> - IN OUT params are not working now (should not be a big problem to fix it)<br> - now mass binding not working too (I've wrote about it before)<br></pre>
+<p>Simplified Connect() and PConnect() error handling.
+</p><p>When extension not loaded, Connect() and PConnect() will return null. On connect error, the fns will return false.
+</p><p>CacheGetArray() added to code.
+</p><p>Added Init() to adorecordset_empty().
+</p><p>Changed postgres64 driver, MetaColumns() to not strip off quotes in default value if :: detected (type-casting of default).
+</p><p>Added test: if (!defined('ADODB_DIR')) die(). Useful to prevent hackers from detecting file paths.
+</p><p>Changed metaTablesSQL to ignore Postgres 7.4 information schemas (sql_*).
+</p><p>New polish language file by  Grzegorz Pacan
+</p><p>Added support for UNION in _adodb_getcount().
+</p><p>Added security check for ADODB_DIR to limit path disclosure issues. Requested by postnuke team.
+</p><p>Added better error message support to oracle driver. Thx to Gaetano Giunta.
+</p><p>Added showSchema support to mysql.
+</p><p>Bind in oci8 did not handle $name=false properly. Fixed.
+</p><p>If extension not loaded, Connect(), PConnect(), NConnect() will return null.
+</p><p><b>4.22  15 Apr   2004</b>
+</p><p>Moved docs to own adodb/docs folder.
+</p><p>Fixed session bug when quoting compressed/encrypted data in Replace().
+</p><p>Netezza Driver and LDAP drivers contributed by Josh Eldridge.
+</p><p>GetMenu now uses rtrim() on values instead of trim().
+</p><p>Changed MetaColumnNames to return an associative array, keys being the field names in uppercase.
+</p><p>Suggested fix to adodb-ado.inc.php affected_rows to support PHP5 variants. Thx to Alexios Fakos.
+</p><p>Contributed bulgarian language file by Valentin Sheiretsky valio#valio.eu.org.
+</p><p>Contributed romanian language file by stefan bogdan.
+</p><p>GetInsertSQL now checks for table name (string) in $rs, and will create a recordset for that
 table automatically. Contributed by Walt Boring. Also added OCI_B_BLOB in bind on Walt's request - hope
 it doesn't break anything :-)
-</font></p><p><font color="#000000">Some minor postgres speedups in _initrs().
-</font></p><p><font color="#000000"> ChangeTableSQL checks now if MetaColumns returns empty. Thx Jason Judge.
-</font></p><p><font color="#000000">Added ADOConnection::Time(), returns current database time in unix timestamp format, or false.
-</font></p><p><font color="#000000"><b>4.21 20 Mar 2004</b>
-</font></p><p><font color="#000000">We no longer in SelectLimit for VFP driver add SELECT TOP X unless an ORDER BY exists.
-</font></p><p><font color="#000000">Pim Koeman contributed dutch language file adodb-nl.inc.php.
-</font></p><p><font color="#000000">Rick Hickerson added CLOB support to db2 datadict.
-</font></p><p><font color="#000000">Added odbtp driver. Thx to "stefan bogdan" sbogdan#rsb.ro.
-</font></p><p><font color="#000000">Changed PrepareSP() 2nd parameter, $cursor, to default to true (formerly false). Fixes oci8 backward
+</p><p>Some minor postgres speedups in _initrs().
+</p><p> ChangeTableSQL checks now if MetaColumns returns empty. Thx Jason Judge.
+</p><p>Added ADOConnection::Time(), returns current database time in unix timestamp format, or false.
+</p><p><b>4.21 20 Mar 2004</b>
+</p><p>We no longer in SelectLimit for VFP driver add SELECT TOP X unless an ORDER BY exists.
+</p><p>Pim Koeman contributed dutch language file adodb-nl.inc.php.
+</p><p>Rick Hickerson added CLOB support to db2 datadict.
+</p><p>Added odbtp driver. Thx to "stefan bogdan" sbogdan#rsb.ro.
+</p><p>Changed PrepareSP() 2nd parameter, $cursor, to default to true (formerly false). Fixes oci8 backward
 compat problems with OUT params.
-</font></p><p><font color="#000000">Fixed month calculation error in adodb-time.inc.php. 2102-June-01 appeared as 2102-May-32.
-</font></p><p><font color="#000000">Updated PHP5 RC1 iterator support. API changed, hasMore() renamed to valid().
-</font></p><p><font color="#000000">Changed internal format of serialized cache recordsets. As we store a version number, this should be
+</p><p>Fixed month calculation error in adodb-time.inc.php. 2102-June-01 appeared as 2102-May-32.
+</p><p>Updated PHP5 RC1 iterator support. API changed, hasMore() renamed to valid().
+</p><p>Changed internal format of serialized cache recordsets. As we store a version number, this should be
 backward compatible.
-</font></p><p><font color="#000000">Error handling when driver file not found was flawed in ADOLoadCode(). Fixed.
-</font></p><p><font color="#000000"><b>4.20 27 Feb 2004</b>
-</font></p><p><font color="#000000">Updated to AXMLS 1.01.
-</font></p><p><font color="#000000">MetaForeignKeys for postgres7 modified by Edward Jaramilla, works on pg 7.4.
-</font></p><p><font color="#000000">Now numbers accepts function calls or sequences for GetInsertSQL/GetUpdateSQL numeric fields.
-</font></p><p><font color="#000000">Changed quotes of 'delete from $perf_table' to "". Thx Kehui (webmaster#kehui.net)
-</font></p><p><font color="#000000">Added ServerInfo() for ifx, and putenv trim fix. Thx Fernando Ortiz.
-</font></p><p><font color="#000000">Added addq(), which is analogous to addslashes().
-</font></p><p><font color="#000000">Tested with php5b4. Fix some php5 compat problems with exceptions and sybase.
-</font></p><p><font color="#000000">Carl-Christian Salvesen added patch to mssql _query to support binds greater than 4000 chars.
-</font></p><p><font color="#000000">Mike suggested patch to PHP5 exception handler. $errno must be numeric.
-</font></p><p><font color="#000000">Added double quotes (") to ADODB_TABLE_REGEX.
-</font></p><p><font color="#000000">For oci8, Prepare(...,$cursor),
+</p><p>Error handling when driver file not found was flawed in ADOLoadCode(). Fixed.
+</p><p><b>4.20 27 Feb 2004</b>
+</p><p>Updated to AXMLS 1.01.
+</p><p>MetaForeignKeys for postgres7 modified by Edward Jaramilla, works on pg 7.4.
+</p><p>Now numbers accepts function calls or sequences for GetInsertSQL/GetUpdateSQL numeric fields.
+</p><p>Changed quotes of 'delete from $perf_table' to "". Thx Kehui (webmaster#kehui.net)
+</p><p>Added ServerInfo() for ifx, and putenv trim fix. Thx Fernando Ortiz.
+</p><p>Added addq(), which is analogous to addslashes().
+</p><p>Tested with php5b4. Fix some php5 compat problems with exceptions and sybase.
+</p><p>Carl-Christian Salvesen added patch to mssql _query to support binds greater than 4000 chars.
+</p><p>Mike suggested patch to PHP5 exception handler. $errno must be numeric.
+</p><p>Added double quotes (") to ADODB_TABLE_REGEX.
+</p><p>For oci8, Prepare(...,$cursor),
 $cursor's meaning was accidentally inverted in 4.11. This causes
 problems with ExecuteCursor() too, which calls Prepare() internally.
 Thx to William Lovaton.
-</font></p><p><font color="#000000">Now dateHasTime property in connection object renamed to datetime for consistency. This could break bc.
-</font></p><p><font color="#000000">Csongor Halmai reports that db2 SelectLimit with input array is not working. Fixed..
-</font></p><p><font color="#000000"><b>4.11 27 Jan 2004</b>
-</font></p><p><font color="#000000">Csongor Halmai reports db2 binding not working. Reverted back to emulated binding.
-</font></p><p><font color="#000000">Dan Cech modifies datadict code. Adds support for DropIndex. Minor cleanups.
-</font></p><p><font color="#000000">Table misspelt in perf-oci8.inc.php. Changed v$conn_cache_advice to v$db_cache_advice. Reported by Steve W.
-</font></p><p><font color="#000000">UserTimeStamp and DBTimeStamp did not handle YYYYMMDDHHMMSS format properly. Reported by Mike Muir. Fixed.
-</font></p><p><font color="#000000">Changed oci8 Prepare(). Does not auto-allocate OCINewCursor automatically, unless 2nd param is set to true.
+</p><p>Now dateHasTime property in connection object renamed to datetime for consistency. This could break bc.
+</p><p>Csongor Halmai reports that db2 SelectLimit with input array is not working. Fixed..
+</p><p><b>4.11 27 Jan 2004</b>
+</p><p>Csongor Halmai reports db2 binding not working. Reverted back to emulated binding.
+</p><p>Dan Cech modifies datadict code. Adds support for DropIndex. Minor cleanups.
+</p><p>Table misspelt in perf-oci8.inc.php. Changed v$conn_cache_advice to v$db_cache_advice. Reported by Steve W.
+</p><p>UserTimeStamp and DBTimeStamp did not handle YYYYMMDDHHMMSS format properly. Reported by Mike Muir. Fixed.
+</p><p>Changed oci8 Prepare(). Does not auto-allocate OCINewCursor automatically, unless 2nd param is set to true.
 This will break backward compat, if Prepare/Execute is used instead of ExecuteCursor. Reported by Chris Jones.
-</font></p><p><font color="#000000">Added InParameter() and OutParameter(). Wrapper functions to Parameter(), but nicer because they
+</p><p>Added InParameter() and OutParameter(). Wrapper functions to Parameter(), but nicer because they
 are self-documenting.
-</font></p><p><font color="#000000">Added 'R' handling in ActualType() to datadict-mysql.inc.php
-</font></p><p><font color="#000000">Added ADOConnection::SerializableRS($rs). Returns a recordset that can be serialized in a session.
-</font></p><p><font color="#000000">Added "Run SQL" to performance UI().
-</font></p><p><font color="#000000">Misc spelling corrections in adodb-mysqli.inc.php, adodb-oci8.inc.php and datadict-oci8.inc.php, from Heinz Hombergs.
-</font></p><p><font color="#000000">MetaIndexes() for ibase contributed by Heinz Hombergs.
-</font></p><p><font color="#000000"><b>4.10 12 Jan 2004</b>
-</font></p><p><font color="#000000">Dan Cech contributed extensive changes to data dictionary to support name quoting (with `), and drop table/index.
-</font></p><p><font color="#000000">Informix added cursorType property. Default remains IFX_SCROLL, but you can change to 0 (non-scrollable cursor) for performance.
-</font></p><p><font color="#000000">Added ADODB_View_PrimaryKeys() for returning view primary keys to MetaPrimaryKeys().
-</font></p><p><font color="#000000">Simplified chinese file, adodb-cn.inc.php from cysoft.
-</font></p><p><font color="#000000">Added check for ctype_alnum in adodb-datadict.inc.php. Thx to Jason Judge.
-</font></p><p><font color="#000000">Added connection parameter to ibase Prepare(). Fix by Daniel Hassan.
-</font></p><p><font color="#000000">Added nameQuote for quoting identifiers and names to connection obj. Requested by Jason Judge. Also the
+</p><p>Added 'R' handling in ActualType() to datadict-mysql.inc.php
+</p><p>Added ADOConnection::SerializableRS($rs). Returns a recordset that can be serialized in a session.
+</p><p>Added "Run SQL" to performance UI().
+</p><p>Misc spelling corrections in adodb-mysqli.inc.php, adodb-oci8.inc.php and datadict-oci8.inc.php, from Heinz Hombergs.
+</p><p>MetaIndexes() for ibase contributed by Heinz Hombergs.
+</p><p><b>4.10 12 Jan 2004</b>
+</p><p>Dan Cech contributed extensive changes to data dictionary to support name quoting (with `), and drop table/index.
+</p><p>Informix added cursorType property. Default remains IFX_SCROLL, but you can change to 0 (non-scrollable cursor) for performance.
+</p><p>Added ADODB_View_PrimaryKeys() for returning view primary keys to MetaPrimaryKeys().
+</p><p>Simplified chinese file, adodb-cn.inc.php from cysoft.
+</p><p>Added check for ctype_alnum in adodb-datadict.inc.php. Thx to Jason Judge.
+</p><p>Added connection parameter to ibase Prepare(). Fix by Daniel Hassan.
+</p><p>Added nameQuote for quoting identifiers and names to connection obj. Requested by Jason Judge. Also the
 data dictionary parser now detects `field name` and generates column names with spaces correctly.
-</font></p><p><font color="#000000">BOOL type not recognised correctly as L. Fixed.
-</font></p><p><font color="#000000">Fixed paths in ADODB_DIR for session files, and back-ported it to 4.05 (15 Dec 2003)
-</font></p><p><font color="#000000">Added Schema to postgresql MetaTables. Thx to col#gear.hu
-</font></p><p><font color="#000000">Empty postgresql recordsets that had blob fields did not set EOF properly. Fixed.
-</font></p><p><font color="#000000">CacheSelectLimit internal parameters to SelectLimit were wrong. Thx to Nio.
-</font></p><p><font color="#000000">Modified adodb_pr() and adodb_backtrace() to support command-line usage (eg. no html).
-</font></p><p><font color="#000000">Fixed some fr and it lang errors. Thx to Gaetano G.
-</font></p><p><font color="#000000">Added contrib directory, with adodb rs to xmlrpc convertor by Gaetano G.
-</font></p><p><font color="#000000">Fixed array recordset bugs when _skiprow1 is true. Thx to Gaetano G.
-</font></p><p><font color="#000000">Fixed pivot table code when count is false.
-</font></p><p>
+</p><p>BOOL type not recognised correctly as L. Fixed.
+</p><p>Fixed paths in ADODB_DIR for session files, and back-ported it to 4.05 (15 Dec 2003)
+</p><p>Added Schema to postgresql MetaTables. Thx to col#gear.hu
+</p><p>Empty postgresql recordsets that had blob fields did not set EOF properly. Fixed.
+</p><p>CacheSelectLimit internal parameters to SelectLimit were wrong. Thx to Nio.
+</p><p>Modified adodb_pr() and adodb_backtrace() to support command-line usage (eg. no html).
+</p><p>Fixed some fr and it lang errors. Thx to Gaetano G.
+</p><p>Added contrib directory, with adodb rs to xmlrpc convertor by Gaetano G.
+</p><p>Fixed array recordset bugs when _skiprow1 is true. Thx to Gaetano G.
+</p><p>Fixed pivot table code when count is false.
+</p><p>
 
-</p><p><font color="#000000"><b>4.05 13 Dec 2003 </b>
-</font></p><p><font color="#000000">Added MetaIndexes - thx to Dan Cech.
-</font></p><p><font color="#000000">Rewritten session code by Ross Smith. Moved code to adodb/session directory.
-</font></p><p><font color="#000000">Added function exists check on connecting to most drivers, so we don't crash with the unknown function error.
-</font></p><p><font color="#000000">Smart Transactions failed with GenID() when it no seq table has been created because the sql
+</p><p><b>4.05 13 Dec 2003 </b>
+</p><p>Added MetaIndexes to data-dict code - thx to Dan Cech.
+</p><p>Rewritten session code by Ross Smith. Moved code to adodb/session directory.
+</p><p>Added function exists check on connecting to most drivers, so we don't crash with the unknown function error.
+</p><p>Smart Transactions failed with GenID() when it no seq table has been created because the sql
 	statement fails. Fix by Mark Newnham.
-</font></p><p><font color="#000000">Added $db-&gt;length, which holds name of function that returns strlen.
-</font></p><p><font color="#000000">Fixed error handling for bad driver in ADONewConnection - passed too few params to error-handler.
-</font></p><p><font color="#000000">Datadict did not handle types like 16.0 properly in _GetSize. Fixed.
-</font></p><p><font color="#000000">Oci8 driver SelectLimit() bug &amp;= instead of =&amp; used. Thx to Swen Th&uuml;mmler.
-</font></p><p><font color="#000000">Jesse Mullan suggested not flushing outp when output buffering enabled. Due to Apache 2.0 bug. Added.
-</font></p><p><font color="#000000">MetaTables/MetaColumns return ref bug with PHP5 fixed in adodb-datadict.inc.php.
-</font></p><p><font color="#000000">New mysqli driver contributed by Arjen de Rijke. Based on adodb 3.40 driver.
+</p><p>Added $db-&gt;length, which holds name of function that returns strlen.
+</p><p>Fixed error handling for bad driver in ADONewConnection - passed too few params to error-handler.
+</p><p>Datadict did not handle types like 16.0 properly in _GetSize. Fixed.
+</p><p>Oci8 driver SelectLimit() bug &amp;= instead of =&amp; used. Thx to Swen Th&uuml;mmler.
+</p><p>Jesse Mullan suggested not flushing outp when output buffering enabled. Due to Apache 2.0 bug. Added.
+</p><p>MetaTables/MetaColumns return ref bug with PHP5 fixed in adodb-datadict.inc.php.
+</p><p>New mysqli driver contributed by Arjen de Rijke. Based on adodb 3.40 driver.
 Then jlim added BeginTrans, CommitTrans, RollbackTrans, IfNull, SQLDate. Also fixed return ref bug.
-</font></p><p><font color="#000000">$ADODB_FLUSH added, if true then force flush in debugging outp. Default is false.  In earlier
+</p><p>$ADODB_FLUSH added, if true then force flush in debugging outp. Default is false.  In earlier
 versions, outp defaulted to flush, which is not compat with apache 2.0.
-</font></p><p><font color="#000000">Mysql driver's GenID() function did not work when when sql logging is on. Fixed.
-</font></p><p><font color="#000000">$ADODB_SESSION_TBL not declared as global var. Not available if adodb-session.inc.php included in function. Fixed.
-</font></p><p><font color="#000000">The input array not passed to Execute() in _adodb_getcount(). Fixed.
-</font></p><p><font color="#000000"><b>4.04 13 Nov 2003 </b>
-</font></p><p><font color="#000000">Switched back to foreach - faster than list-each.
-</font></p><p><font color="#000000">Fixed bug in ado driver - wiping out $this-&gt;fields with date fields.
-</font></p><p><font color="#000000">Performance Monitor, View SQL, Explain Plan did not work if strlen($SQL)&gt;max($_GET length). Fixed.
-</font></p><p><font color="#000000">Performance monitor, oci8 driver added memory sort ratio.
-</font></p><p><font color="#000000">Added random property, returns SQL to generate a floating point number between 0 and 1;
-</font></p><p><font color="#000000"><b>4.03 6 Nov 2003 </b>
-</font></p><p><font color="#000000">The path to adodb-php4.inc.php and adodb-iterators.inc.php was not setup properly.
-</font></p><p><font color="#000000">Patched SQLDate in interbase to support hours/mins/secs. Thx to ari kuorikoski.
-</font></p><p><font color="#000000">Force autorollback for pgsql persistent connections - 
+</p><p>Mysql driver's GenID() function did not work when when sql logging is on. Fixed.
+</p><p>$ADODB_SESSION_TBL not declared as global var. Not available if adodb-session.inc.php included in function. Fixed.
+</p><p>The input array not passed to Execute() in _adodb_getcount(). Fixed.
+</p><p><b>4.04 13 Nov 2003 </b>
+</p><p>Switched back to foreach - faster than list-each.
+</p><p>Fixed bug in ado driver - wiping out $this-&gt;fields with date fields.
+</p><p>Performance Monitor, View SQL, Explain Plan did not work if strlen($SQL)&gt;max($_GET length). Fixed.
+</p><p>Performance monitor, oci8 driver added memory sort ratio.
+</p><p>Added random property, returns SQL to generate a floating point number between 0 and 1;
+</p><p><b>4.03 6 Nov 2003 </b>
+</p><p>The path to adodb-php4.inc.php and adodb-iterators.inc.php was not setup properly.
+</p><p>Patched SQLDate in interbase to support hours/mins/secs. Thx to ari kuorikoski.
+</p><p>Force autorollback for pgsql persistent connections - 
 apparently pgsql did not autorollback properly before 4.3.4. See http://bugs.php.net/bug.php?id=25404
-</font></p><p><font color="#000000"><b>4.02 5 Nov 2003 </b>
-</font></p><p><font color="#000000">Some errors in adodb_error_pg() fixed. Thx to Styve.
-</font></p><p><font color="#000000">Spurious Insert_ID() error was generated by LogSQL(). Fixed.
-</font></p><p><font color="#000000">Insert_ID was interfering with Affected_Rows() and Replace()  when LogSQL() enabled. Fixed.
-</font></p><p><font color="#000000">More foreach loops optimized with list/each.
-</font></p><p><font color="#000000">Null dates not handled properly in ADO driver (it becomes 31 Dec 1969!).
-</font></p><p><font color="#000000">Heinz Hombergs contributed patches for mysql MetaColumns - adding scale, made
+</p><p><b>4.02 5 Nov 2003 </b>
+</p><p>Some errors in adodb_error_pg() fixed. Thx to Styve.
+</p><p>Spurious Insert_ID() error was generated by LogSQL(). Fixed.
+</p><p>Insert_ID was interfering with Affected_Rows() and Replace()  when LogSQL() enabled. Fixed.
+</p><p>More foreach loops optimized with list/each.
+</p><p>Null dates not handled properly in ADO driver (it becomes 31 Dec 1969!).
+</p><p>Heinz Hombergs contributed patches for mysql MetaColumns - adding scale, made
 interbase MetaColumns work with firebird/interbase, and added lang/adodb-de.inc.php.
-</font></p><p><font color="#000000">Added INFORMIXSERVER environment variable.
-</font></p><p><font color="#000000">Added $ADODB_ANSI_PADDING_OFF for interbase/firebird.
-</font></p><p><font color="#000000">PHP 5 beta 2 compat check. Foreach (Iterator) support. Exceptions support.
-</font></p><p><font color="#000000"><b>4.01 23 Oct 2003 </b>
-</font></p><p><font color="#000000">Fixed bug in rs2html(), tohtml.inc.php, that generated blank table cells.
-</font></p><p><font color="#000000">Fixed insert_id() incorrectly generated when logsql() enabled.
-</font></p><p><font color="#000000">Modified PostgreSQL _fixblobs to use list/each instead of foreach.
-</font></p><p><font color="#000000">Informix ErrorNo() implemented correctly.
-</font></p><p><font color="#000000">Modified several places to use list/each, including GetRowAssoc().
-</font></p><p><font color="#000000">Added UserTimeStamp() to connection class.
-</font></p><p><font color="#000000">Added $ADODB_ANSI_PADDING_OFF for oci8po.
-</font></p><p><font color="#000000"><b>4.00 20 Oct 2003 </b>
-</font></p><p><font color="#000000">Upgraded adodb-xmlschema to 1 Oct 2003 snapshot.
-</font></p><p><font color="#000000">Fix to rs2html warning message. Thx to Filo.
-</font></p><p><font color="#000000">Fix for odbc_mssql/mssql SQLDate(), hours was wrong.
-</font></p><p><font color="#000000">Added MetaColumns and MetaPrimaryKeys for sybase. Thx to Chris Phillipson.
-</font></p><p><font color="#000000">Added autoquoting to datadict for MySQL and PostgreSQL. Suggestion by Karsten Dambekalns  
-</font></p><p><font color="#000000"><b>3.94 11 Oct 2003 </b>
-</font></p><p><font color="#000000">Create trigger in datadict-oci8.inc.php did not work, because all cr/lf's must be removed. 
-</font></p><p><font color="#000000">ErrorMsg()/ErrorNo() did not work for many databases when logging enabled. Fixed.
-</font></p><p><font color="#000000">Removed global variable $ADODB_LOGSQL as it does not work properly with multiple connections.
-</font></p><p><font color="#000000">Added SQLDate support for sybase. Thx to Chris Phillipson
-</font></p><p><font color="#000000">Postgresql checking of pgsql resultset resource was incorrect. Fix by Bharat Mediratta bharat#menalto.com.
+</p><p>Added INFORMIXSERVER environment variable.
+</p><p>Added $ADODB_ANSI_PADDING_OFF for interbase/firebird.
+</p><p>PHP 5 beta 2 compat check. Foreach (Iterator) support. Exceptions support.
+</p><p><b>4.01 23 Oct 2003 </b>
+</p><p>Fixed bug in rs2html(), tohtml.inc.php, that generated blank table cells.
+</p><p>Fixed insert_id() incorrectly generated when logsql() enabled.
+</p><p>Modified PostgreSQL _fixblobs to use list/each instead of foreach.
+</p><p>Informix ErrorNo() implemented correctly.
+</p><p>Modified several places to use list/each, including GetRowAssoc().
+</p><p>Added UserTimeStamp() to connection class.
+</p><p>Added $ADODB_ANSI_PADDING_OFF for oci8po.
+</p><p><b>4.00 20 Oct 2003 </b>
+</p><p>Upgraded adodb-xmlschema to 1 Oct 2003 snapshot.
+</p><p>Fix to rs2html warning message. Thx to Filo.
+</p><p>Fix for odbc_mssql/mssql SQLDate(), hours was wrong.
+</p><p>Added MetaColumns and MetaPrimaryKeys for sybase. Thx to Chris Phillipson.
+</p><p>Added autoquoting to datadict for MySQL and PostgreSQL. Suggestion by Karsten Dambekalns  
+</p><p><b>3.94 11 Oct 2003 </b>
+</p><p>Create trigger in datadict-oci8.inc.php did not work, because all cr/lf's must be removed. 
+</p><p>ErrorMsg()/ErrorNo() did not work for many databases when logging enabled. Fixed.
+</p><p>Removed global variable $ADODB_LOGSQL as it does not work properly with multiple connections.
+</p><p>Added SQLDate support for sybase. Thx to Chris Phillipson
+</p><p>Postgresql checking of pgsql resultset resource was incorrect. Fix by Bharat Mediratta bharat#menalto.com.
 Same patch applied to  _insertid and _affectedrows for adodb-postgres64.inc.php.
-</font></p><p><font color="#000000">Added support for NConnect for postgresql.
-</font></p><p><font color="#000000">Added Sybase data dict support. Thx to Chris Phillipson  
-</font></p><p><font color="#000000">Extensive improvements in $perf-&gt;UI(), eg. Explain now opens in new window, we show scripts
+</p><p>Added support for NConnect for postgresql.
+</p><p>Added Sybase data dict support. Thx to Chris Phillipson  
+</p><p>Extensive improvements in $perf-&gt;UI(), eg. Explain now opens in new window, we show scripts
 which call sql, etc.
-</font></p><p><font color="#000000">Perf Monitor UI works with magic quotes enabled.
-</font></p><p><font color="#000000">rsPrefix was declared twice. Removed.
-</font></p><p><font color="#000000">Oci8 stored procedure support, eg. "begin func(); end;" was incorrect in _query. Fixed.
-</font></p><p><font color="#000000">Tiraboschi Massimiliano contributed italian language file.
-</font></p><p><font color="#000000">Fernando Ortiz, fortiz#lacorona.com.mx, contributed informix performance monitor.
-</font></p><p><font color="#000000">Added _varchar (varchar arrays) support for postgresql. Reported by PREVOT St&eacute;phane.
-</font></p><p><font color="#000000"><b>3.92 22 Sept 2003</b> 
-</font></p><p><font color="#000000">Added GetAssoc and CacheGetAssoc to connection object.
-</font></p><p><font color="#000000">Removed TextMax and CharMax functions from adodb.inc.php. 
-</font></p><p><font color="#000000">HasFailedTrans() returned false when trans failed. Fixed. 
-</font></p><p><font color="#000000">Moved perf driver classes into adodb/perf/*.php. 
-</font></p><p><font color="#000000">Misc improvements to performance monitoring, including UI(). 
-</font></p><p><font color="#000000">RETVAL in mssql Parameter(), we do not append @ now. 
-</font></p><p><font color="#000000">Added Param($name) to connection class, returns '?' or ":$name", for defining 
-  bind parameters portably. 
-</font></p><p><font color="#000000">LogSQL traps affected_rows() and saves its value properly now. Also fixed oci8 
-  _stmt and _affectedrows() bugs. 
-</font></p><p><font color="#000000">Session code timestamp check for oci8 works now. Formerly default NLS_DATE_FORMAT 
-  stripped off time portion. Thx to Tony Blair (tonanbarbarian#hotmail.com). Also 
-  added new $conn-&gt;datetime field to oci8, controls whether MetaType() returns 
-  'D' ($this-&gt;datetime==false) or 'T' ($this-&gt;datetime == true) for DATE type. 
-</font></p><p><font color="#000000">Fixed bugs in adodb-cryptsession.inc.php and adodb-session-clob.inc.php. 
-</font></p><p><font color="#000000">Fixed misc bugs in adodb_key_exists, GetInsertSQL() and GetUpdateSQL(). 
-</font></p><p><font color="#000000">Tuned include_once handling to reduce file-system checking overhead. 
-</font></p><p><font color="#000000"><b>3.91 9 Sept 2003</b> 
-</font></p><p><font color="#000000">Only released to InterAkt 
-</font></p><p><font color="#000000">Added LogSQL() for sql logging and $ADODB_NEWCONNECTION to override factory 
-  for driver instantiation. 
-</font></p><p><font color="#000000">Added IfNull($field,$ifNull) function, thx to johnwilk#juno.com 
-</font></p><p><font color="#000000">Added portable substr support. 
-</font></p><p><font color="#000000">Now rs2html() has new parameter, $echo. Set to false to return $html instead 
-  of echoing it. 
-</font></p><p><font color="#000000"><b>3.90 5 Sept 2003</b> 
-</font></p><p><font color="#000000">First beta of performance monitoring released. 
-</font></p><p><font color="#000000">MySQL supports MetaTable() masking. 
-</font></p><p><font color="#000000">Fixed key_exists() bug in adodb-lib.inc.php 
-</font></p><p><font color="#000000">Added sp_executesql Prepare() support to mssql. 
-</font></p><p><font color="#000000">Added bind support to db2. 
-</font></p><p><font color="#000000">Added swedish language file - Christian Tiberg" christian#commsoft.nu 
-</font></p><p><font color="#000000">Bug in drop index for mssql data dict fixed. Thx to Gert-Rainer Bitterlich. 
-</font></p><p><font color="#000000">Left join setting for oci8 was wrong. Thx to johnwilk#juno.com 
-</font></p><p><font color="#000000"><b>3.80 27 Aug 2003</b> 
-</font></p><p><font color="#000000">Patch for PHP 4.3.3 cached recordset csv2rs() fread loop incompatibility. 
-</font></p><p><font color="#000000">Added matching mask for MetaTables. Only for oci8, mssql and postgres currently. 
-</font></p><p><font color="#000000">Rewrite of "oracle" driver connection code, merging with "oci8", by Gaetano. 
-</font></p><p><font color="#000000">Added better debugging for Smart Transactions. 
-</font></p><p><font color="#000000">Postgres DBTimeStamp() was wrongly using TO_DATE. Changed to TO_TIMESTAMP. 
-</font></p><p><font color="#000000">ADODB_FETCH_CASE check pushed to ADONewConnection to allow people to define 
-  it after including adodb.inc.php. 
-</font></p><p><font color="#000000">Added portugese (brazilian) to languages. Thx to "Levi Fukumori". 
-</font></p><p><font color="#000000">Removed arg3 parameter from Execute/SelectLimit/Cache* functions. 
-</font></p><p><font color="#000000">Execute() now accepts 2-d array as $inputarray. Also changed docs of fnExecute() 
-  to note change in sql query counting with 2-d arrays. 
-</font></p><p><font color="#000000">Added MONEY to MetaType in PostgreSQL. 
-</font></p><p><font color="#000000">Added more debugging output to CacheFlush(). 
-</font></p><p><font color="#000000"><b>3.72 9 Aug 2003</b> 
-</font></p><p><font color="#000000">Added qmagic($str), which is a qstr($str) that auto-checks for magic quotes 
-  and does the right thing... 
-</font></p><p><font color="#000000">Fixed CacheFlush() bug - Thx to martin#gmx.de 
-</font></p><p><font color="#000000">Walt Boring contributed MetaForeignKeys for postgres7. 
-</font></p><p><font color="#000000">_fetch() called _BlobDecode() wrongly in interbase. Fixed. 
-</font></p><p><font color="#000000">adodb_time bug fixed with dates after 2038 fixed by Jason Pell. http://phplens.com/lens/lensforum/msgs.php?id=6980 
-</font></p><p><font color="#000000"><b>3.71 4 Aug 2003</b> 
-</font></p><p><font color="#000000">The oci8 driver, MetaPrimaryKeys() did not check the owner correctly when $owner 
-  == false. 
-</font></p><p><font color="#000000">Russian language file contributed by "Cyrill Malevanov" cyrill#malevanov.spb.ru. 
-</font></p><p><font color="#000000">Spanish language file contributed by "Horacio Degiorgi" horaciod#codigophp.com. 
-</font></p><p><font color="#000000">Error handling in oci8 bugfix - if there was an error in Execute(), then when 
-  calling ErrorNo() and/or ErrorMsg(), the 1st call would return the error, but 
-  the 2nd call would return no error. 
-</font></p><p><font color="#000000">Error handling in odbc bugfix. ODBC would always return the last error, even 
-  if it happened 5 queries ago. Now we reset the errormsg to '' and errorno to 
-  0 everytime before CacheExecute() and Execute(). 
-</font></p><p><font color="#000000"><b>3.70 29 July 2003</b> 
-</font></p><p><font color="#000000">Added new SQLite driver. Tested on PHP 4.3 and PHP 5. 
-</font></p><p><font color="#000000">Added limited "sapdb" driver support - mainly date support. 
-</font></p><p><font color="#000000">The oci8 driver did not identify NUMBER with no defined precision correctly. 
-</font></p><p><font color="#000000">Added ADODB_FORCE_NULLS, if set, then PHP nulls are converted to SQL nulls 
-  in GetInsertSQL/GetUpdateSQL. 
-</font></p><p><font color="#000000">DBDate() and DBTimeStamp() format for postgresql had problems. Fixed. 
-</font></p><p><font color="#000000">Added tableoptions to ChangeTableSQL(). Thx to Mike Benoit. 
-</font></p><p><font color="#000000">Added charset support to postgresql. Thx to Julian Tarkhanov. 
-</font></p><p><font color="#000000">Changed OS check for MS-Windows to prevent confusion with darWIN (MacOS) 
-</font></p><p><font color="#000000">Timestamp format for db2 was wrong. Changed to yyyy-mm-dd-hh.mm.ss.nnnnnn. 
-</font></p><p><font color="#000000">adodb-cryptsession.php includes wrong. Fixed. 
-</font></p><p><font color="#000000">Added MetaForeignKeys(). Supported by mssql, odbc_mssql and oci8. 
-</font></p><p><font color="#000000">Fixed some oci8 MetaColumns/MetaPrimaryKeys bugs. Thx to Walt Boring. 
-</font></p><p><font color="#000000">adodb_getcount() did not init qryRecs to 0. Missing "WHERE" clause checking 
-  in GetUpdateSQL fixed. Thx to Sebastiaan van Stijn. 
-</font></p><p><font color="#000000">Added support for only 'VIEWS' and "TABLES" in MetaTables. From Walt Boring. 
-</font></p><p><font color="#000000">Upgraded to adodb-xmlschema.inc.php 0.0.2. 
-</font></p><p><font color="#000000">NConnect for mysql now returns value. Thx to Dennis Verspuij. 
-</font></p><p><font color="#000000">ADODB_FETCH_BOTH support added to interbase/firebird. 
-</font></p><p><font color="#000000">Czech language file contributed by Kamil Jakubovic jake#host.sk. 
-</font></p><p><font color="#000000">PostgreSQL BlobDecode did not use _connectionID properly. Thx to Juraj Chlebec. 
-</font></p><p><font color="#000000">Added some new initialization stuff for Informix. Thx to "Andrea Pinnisi" pinnisi#sysnet.it 
-</font></p><p><font color="#000000">ADODB_ASSOC_CASE constant wrong in sybase _fetch(). Fixed. 
-</font></p><p><font color="#000000"><b>3.60 16 June 2003</b> 
-</font></p><p><font color="#000000">We now SET CONCAT_NULL_YIELDS_NULL OFF for odbc_mssql driver to be compat with 
-  mssql driver. 
-</font></p><p><font color="#000000">The property $emptyDate missing from connection class. Also changed 1903 to 
-  constant (TIMESTAMP_FIRST_YEAR=100). Thx to Sebastiaan van Stijn. 
-</font></p><p><font color="#000000">ADOdb speedup optimization - we now return all arrays by reference. 
-</font></p><p><font color="#000000">Now DBDate() and DBTimeStamp() now accepts the string 'null' as a parameter. 
-  Suggested by vincent. 
-</font></p><p><font color="#000000">Added GetArray() to connection class. 
-</font></p><p><font color="#000000">Added not_null check in informix metacolumns(). 
-</font></p><p><font color="#000000">Connection parameters for postgresql did not work correctly when port was defined. 
-</font></p><p><font color="#000000">DB2 is now a tested driver, making adodb 100% compatible. Extensive changes 
-  to odbc driver for DB2, including implementing serverinfo() and SQLDate(), switching 
-  to SQL_CUR_USE_ODBC as the cursor mode, and lastAffectedRows and SelectLimit() 
-  fixes. 
-</font></p><p><font color="#000000">The odbc driver's FetchField() field names did not obey ADODB_ASSOC_CASE. Fixed. 
-</font></p><p><font color="#000000">Some bugs in adodb_backtrace() fixed. 
-</font></p><p><font color="#000000">Added "INT IDENTITY" type to adorecordset::MetaType() to support odbc_mssql 
-  properly. 
-</font></p><p><font color="#000000">MetaColumns() for oci8, mssql, odbc revised to support scale. Also minor revisions 
-  to odbc MetaColumns() for vfp and db2 compat. 
-</font></p><p><font color="#000000">Added unsigned support to mysql datadict class. Thx to iamsure. 
-</font></p><p><font color="#000000">Infinite loop in mssql MoveNext() fixed when ADODB_FETCH_ASSOC used. Thx to 
-  Josh R, Night_Wulfe#hotmail.com. 
-</font></p><p><font color="#000000">ChangeTableSQL contributed by Florian Buzin. 
-</font></p><p><font color="#000000">The odbc_mssql driver now sets CONCAT_NULL_YIELDS_NULL OFF for compat with 
-  mssql driver. 
-</font></p><hr>
-<p><font color="#000000"><strong>0.10 Sept 9 2000</strong> First release 
-</font></p><h3><font color="#000000"><strong>Old changelog history moved to <a href="old-changelog.htm">old-changelog.htm</a>. 
-  </strong></font></h3>
-<p><font color="#000000">&nbsp;</font></p>
-<p><font color="#000000"> </font> 
+</p><p>Perf Monitor UI works with magic quotes enabled.
+</p><p>rsPrefix was declared twice. Removed.
+</p><p>Oci8 stored procedure support, eg. "begin func(); end;" was incorrect in _query. Fixed.
+</p><p>Tiraboschi Massimiliano contributed italian language file.
+</p><p>Fernando Ortiz, fortiz#lacorona.com.mx, contributed informix performance monitor.
+</p><p>Added _varchar (varchar arrays) support for postgresql. Reported by PREVOT St&eacute;phane.<hr>
+<p><strong>0.10 Sept 9 2000</strong> First release 
+</p><h3><strong>Old change log history moved to <a href="old-changelog.htm">old-changelog.htm</a>. 
+  </strong></h3>
+<p>&nbsp;</p>
+<p>  
 </p></body></html>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/docs/docs-datadict.htm
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/docs/docs-datadict.htm	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/docs/docs-datadict.htm	2005-04-08 19:43:46 UTC (rev 1788)
@@ -20,22 +20,13 @@
 </head>
 <body style="background-color: rgb(255, 255, 255);">
 <h2>ADOdb Data Dictionary Library for PHP</h2>
-<p>V4.54 5 Nov 2004 (c) 2000-2004 John Lim (<a
+<p>V4.62 2 Apr 2005 (c) 2000-2005 John Lim (<a
  href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>).<br>
 AXMLS (c) 2004 ars Cognita, Inc</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products.</font></p>
-<table border="1">
-  <tbody>
-    <tr>
-      <td height="38"><font color="red">Kindly note that the ADOdb home page has
-moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a>
-because of the persistent unreliability of http://php.weblogs.com. <b>Please
-change your links</b>!</font></td>
-    </tr>
-  </tbody>
-</table>
+
 <p>Useful ADOdb links: <a href="http://adodb.sourceforge.net/#download">Download</a>
 &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 </p>
@@ -83,7 +74,7 @@
 field type can be a portable type codes or the actual type for that
 database.</p>
 <p>Legal portable type codes include:</p>
-<pre>  C:  varchar<br>  X:  Largest varchar size <br>  XL: For Oracle, returns CLOB, otherwise same as 'X' above<br><br>  C2: Multibyte varchar<br>  X2: Multibyte varchar (largest size)<br><br>  B:  BLOB (binary large object)<br><br>  D:  Date (some databases do not support this, and we return a datetime type)<br>  T:  Datetime or Timestamp<br>  L:  Integer field suitable for storing booleans (0 or 1)<br>  I:  Integer (mapped to I4)<br>  I1: 1-byte integer<br>  I2: 2-byte integer<br>  I4: 4-byte integer<br>  I8: 8-byte integer<br>  F:  Floating point number<br>  N:  Numeric or decimal number<br></pre>
+<pre>  C:  Varchar, capped to 255 characters.<br>  X:  Larger varchar, capped to 4000 characters (to be compatible with Oracle). <br>  XL: For Oracle, returns CLOB, otherwise the largest varchar size.<br><br>  C2: Multibyte varchar<br>  X2: Multibyte varchar (largest size)<br><br>  B:  BLOB (binary large object)<br><br>  D:  Date (some databases do not support this, and we return a datetime type)<br>  T:  Datetime or Timestamp<br>  L:  Integer field suitable for storing booleans (0 or 1)<br>  I:  Integer (mapped to I4)<br>  I1: 1-byte integer<br>  I2: 2-byte integer<br>  I4: 4-byte integer<br>  I8: 8-byte integer<br>  F:  Floating point number<br>  N:  Numeric or decimal number<br></pre>
 <p>The $colsize field represents the size of the field. If a decimal
 number is used, then it is assumed that the number following the dot is
 the precision, so 6.2 means a number of size 6 digits and 2 decimal

Modified: plog/branches/plog-1.0.1/class/database/adodb/docs/docs-oracle.htm
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/docs/docs-oracle.htm	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/docs/docs-oracle.htm	2005-04-08 19:43:46 UTC (rev 1788)
@@ -14,6 +14,7 @@
   font-size: 12px;
   border: 1px solid #ddd;
 }
+.style1 {color: #660000}
 </style>
 <title>ADOdb with PHP and Oracle</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
@@ -264,7 +265,22 @@
 $db->UpdateClob('aTable', 'aclob', $clobValue, 'id=aSequence.currVal');
 </pre>
 <p>Note that LogError( ) is a user-defined function, and not part of ADOdb.
-<p>&nbsp;
+<p>Inserting LOBs is more complicated. Since ADOdb 4.55, we allow you to do this
+  (assuming that the <em>photo</em> field is a BLOB, and we want to store $blob_data into
+  this field, and the primary key is the <em>id</em> field):
+<pre>
+	$sql = <span class="style1">"INSERT INTO photos ( ID, photo) ".
+			"VALUES ( :id, empty_blob() )".
+			" RETURNING photo INTO :xx"</span>;
+
+ 		$stmt = $db->PrepareSP($sql);
+		$db->InParameter($stmt, $<strong>id</strong>, <span class="style1">'id'</span>);
+		$blob = $db->InParameter($stmt, $<strong>blob_data</strong>, <span class="style1">'xx'</span>,-1, OCI_B_BLOB);
+		$db->StartTrans();
+		$ok = $db->Execute($stmt);
+		$db->CompleteTrans();
+</pre> 
+<p>
 <h3>5. REF CURSORs</h3>
 <p>Oracle recordsets can be passed around as variables called REF Cursors. For example, in PL/SQL, we could define a function <i>open_tab</i> that returns a REF CURSOR in the first parameter:</p>
 <pre>
@@ -357,7 +373,7 @@
 $db-&gt;Execute($sql);
 </pre>
 <p>If you are not concerned about date portability and do not use ADOdb's portability layer, you can use your preferred date format instead.
-<p>&nbsp;
+<p>
 <h3>8. Database Portability Layer</h3>
 <p>ADOdb provides the following functions for portably generating SQL functions 
   as strings to be merged into your SQL statements:</p>

Modified: plog/branches/plog-1.0.1/class/database/adodb/docs/docs-perf.htm
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/docs/docs-perf.htm	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/docs/docs-perf.htm	2005-04-08 19:43:46 UTC (rev 1788)
@@ -18,20 +18,10 @@
 </head>
 <body>
 <h3>The ADOdb Performance Monitoring Library</h3>
-<p>V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my)</p>
+<p>V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)</p>
 <p><font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products.</font></p>
-<table border="1">
-  <tbody>
-    <tr>
-      <td><font color="red">Kindly note that the ADOdb home page has
-moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a>
-because of the persistent unreliability of http://php.weblogs.com. <b>Please
-change your links</b>!</font></td>
-    </tr>
-  </tbody>
-</table>
 <p>Useful ADOdb links: <a href="http://adodb.sourceforge.net/#download">Download</a>
 &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 </p>

Modified: plog/branches/plog-1.0.1/class/database/adodb/docs/docs-session.htm
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/docs/docs-session.htm	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/docs/docs-session.htm	2005-04-08 19:43:46 UTC (rev 1788)
@@ -21,24 +21,11 @@
 <body style="background-color: rgb(255, 255, 255);">
 <h3>ADODB Session Management Manual</h3>
 <p>
-V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim#natsoft.com.my)
+V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my)
 </p>
 <p> <font size="1">This software is dual licensed using BSD-Style and
 LGPL. This means you can use it in compiled proprietary and commercial
 products. </font>
-<table border="1">
-  <tbody>
-    <tr>
-      <td><font color="red">Kindly note that the ADOdb home page has
-moved to <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a>
-because of the persistent unreliability of http://php.weblogs.com. <b>Please
-change your links</b>!</font></td>
-    </tr>
-    <tr>
-    </tr>
-  </tbody>
-</table>
-<p></p>
 <p>Useful ADOdb links: <a href="http://adodb.sourceforge.net/#download">Download</a>
 &nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a>
 </p>
@@ -61,9 +48,12 @@
   <li>Need to do special processing of each session</li>
   <li>Require notification when a session expires</li>
 </ul>
-<p>Then the ADOdb session handler provides you with the above
+<p>The ADOdb session handler provides you with the above
 additional capabilities by storing the session information as records
 in a database table that can be shared across multiple servers. </p>
+<p>These records will be garbage collected based on the php.ini [session] timeout settings. 
+You can register a notification function to notify you when the record has expired and 
+is about to be freed by the garbage collector.</p>
 <p><b>Important Upgrade Notice:</b> Since ADOdb 4.05, the session files
 have been moved to its own folder, adodb/session. This is a rewrite
 of the session code by Ross Smith. The old session code is in
@@ -149,22 +139,35 @@
  </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 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
-the definition of the sessions table above). Before any session record
-is deleted, ADOdb will call a notification function, passing in the
-EXPIREREF.
-</p>
-<p>When a session is first created, we check a global variable
-$ADODB_SESSION_EXPIRE_NOTIFY. This is an array with 2 elements, the
+<p>You can receive notification when your session is cleaned up by the session garbage collector or
+when you call session_destroy().
+<p>PHP's session extension will automatically run a special garbage collection function based on
+your php.ini session.cookie_lifetime and session.gc_probability settings. This will in turn call
+adodb's garbage collection function, which can be setup to do notification.
+<p>
+<pre>
+	PHP Session --> ADOdb Session  --> Find all recs  --> Send          --> Delete queued
+	GC Function     GC Function        to be deleted      notification      records
+	executed at     called by                             for all recs
+	random time     Session Extension                     queued for deletion
+</pre>
+<p>When a session is created, we need to store a value in the session record (in the EXPIREREF field), typically 
+the userid of the session. Later when the session has expired,  just before the record is deleted,
+we reload the EXPIREREF field and call the notification function with the value of EXPIREREF, which 
+is the userid of the person being logged off.
+<p>ADOdb use a global variable $ADODB_SESSION_EXPIRE_NOTIFY that you must predefine before session
+start to store the notification configuratioin. 
+$ADODB_SESSION_EXPIRE_NOTIFY is an array with 2 elements, the
 first being the name of the session variable you would like to store in
 the EXPIREREF field, and the 2nd is the notification function's name. </p>
-<p> Suppose we want to be notified when a user's session has expired,
-based on the userid. The user id in the global session variable
-$USERID. The function name is 'NotifyFn'. So we define: </p>
+<p>For example, suppose we want to be notified when a user's session has expired,
+based on the userid. When the user logs in, we store the id in the global session variable
+$USERID. The function name is 'NotifyFn'. 
+<p>
+So we define (before session_start() is called): </p>
 <pre> <font color="#004040"><br>        $ADODB_SESSION_EXPIRE_NOTIFY = array('USERID','NotifyFn');<br>    </font></pre>
-And when the NotifyFn is called (when the session expires), we pass the
-$USERID as the first parameter, eg. NotifyFn($userid, $sesskey). The
+And when the NotifyFn is called (when the session expires), the
+$USERID is passed in as the first parameter, eg. NotifyFn($userid, $sesskey). The
 session key (which is the primary key of the record in the sessions
 table) is the 2nd parameter.
 <p> Here is an example of a Notification function that deletes some
@@ -202,6 +205,28 @@
 <p>These are stackable. E.g.
 <p><pre>ADODB_Session::filter(new ADODB_Compress_Bzip2());<br>ADODB_Session::filter(new ADODB_Encrypt_MD5());<br></pre>
 will compress and then encrypt the record in the database.
+<h3>adodb_session_regenerate_id()</h3>
+<p>Dynamically change the current session id with a newly generated one and update database. Currently only
+works with cookies. Useful to improve security by reducing the risk of session-hijacking.
+See this article on <a href=http://shiflett.org/articles/security-corner-feb2004>Session Fixation</a> for more info 
+on the theory behind this feature. Usage:
+<pre>
+	$ADODB_SESSION_DRIVER='mysql';
+	$ADODB_SESSION_CONNECT='localhost';
+	$ADODB_SESSION_USER ='root';
+	$ADODB_SESSION_PWD ='abc';
+	$ADODB_SESSION_DB ='phplens';
+	
+	include('path/to/adodb/session/adodb-session.php');
+	
+	session_start();
+	# Every 10 page loads, reset cookie for safety.
+	# This is extremely simplistic example, better 
+	# to regenerate only when the user logs in or changes
+	# user privilege levels.
+	if ((rand()%10) == 0) adodb_session_regenerate_id(); </pre>
+<p>This function calls session_regenerate_id() internally or simulates it if the function does not exist.
+<h2>More Info</h2>
 <p>Also see the <a href="docs-adodb.htm">core ADOdb documentation</a>.
 </p>
 </body>

Modified: plog/branches/plog-1.0.1/class/database/adodb/docs/old-changelog.htm
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/docs/old-changelog.htm	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/docs/old-changelog.htm	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,4 +1,126 @@
+<html><title>Old Changelog: ADOdb</title><body>
 <h3>Old Changelog</h3>
+
+</p><p><b>3.92 22 Sept 2003</b> 
+</p><p>Added GetAssoc and CacheGetAssoc to connection object.
+</p><p>Removed TextMax and CharMax functions from adodb.inc.php. 
+</p><p>HasFailedTrans() returned false when trans failed. Fixed. 
+</p><p>Moved perf driver classes into adodb/perf/*.php. 
+</p><p>Misc improvements to performance monitoring, including UI(). 
+</p><p>RETVAL in mssql Parameter(), we do not append @ now. 
+</p><p>Added Param($name) to connection class, returns '?' or ":$name", for defining 
+  bind parameters portably. 
+</p><p>LogSQL traps affected_rows() and saves its value properly now. Also fixed oci8 
+  _stmt and _affectedrows() bugs. 
+</p><p>Session code timestamp check for oci8 works now. Formerly default NLS_DATE_FORMAT 
+  stripped off time portion. Thx to Tony Blair (tonanbarbarian#hotmail.com). Also 
+  added new $conn-&gt;datetime field to oci8, controls whether MetaType() returns 
+  'D' ($this-&gt;datetime==false) or 'T' ($this-&gt;datetime == true) for DATE type. 
+</p><p>Fixed bugs in adodb-cryptsession.inc.php and adodb-session-clob.inc.php. 
+</p><p>Fixed misc bugs in adodb_key_exists, GetInsertSQL() and GetUpdateSQL(). 
+</p><p>Tuned include_once handling to reduce file-system checking overhead. 
+</p><p><b>3.91 9 Sept 2003</b> 
+</p><p>Only released to InterAkt 
+</p><p>Added LogSQL() for sql logging and $ADODB_NEWCONNECTION to override factory 
+  for driver instantiation. 
+</p><p>Added IfNull($field,$ifNull) function, thx to johnwilk#juno.com 
+</p><p>Added portable substr support. 
+</p><p>Now rs2html() has new parameter, $echo. Set to false to return $html instead 
+  of echoing it. 
+</p><p><b>3.90 5 Sept 2003</b> 
+</p><p>First beta of performance monitoring released. 
+</p><p>MySQL supports MetaTable() masking. 
+</p><p>Fixed key_exists() bug in adodb-lib.inc.php 
+</p><p>Added sp_executesql Prepare() support to mssql. 
+</p><p>Added bind support to db2. 
+</p><p>Added swedish language file - Christian Tiberg" christian#commsoft.nu 
+</p><p>Bug in drop index for mssql data dict fixed. Thx to Gert-Rainer Bitterlich. 
+</p><p>Left join setting for oci8 was wrong. Thx to johnwilk#juno.com 
+</p><p><b>3.80 27 Aug 2003</b> 
+</p><p>Patch for PHP 4.3.3 cached recordset csv2rs() fread loop incompatibility. 
+</p><p>Added matching mask for MetaTables. Only for oci8, mssql and postgres currently. 
+</p><p>Rewrite of "oracle" driver connection code, merging with "oci8", by Gaetano. 
+</p><p>Added better debugging for Smart Transactions. 
+</p><p>Postgres DBTimeStamp() was wrongly using TO_DATE. Changed to TO_TIMESTAMP. 
+</p><p>ADODB_FETCH_CASE check pushed to ADONewConnection to allow people to define 
+  it after including adodb.inc.php. 
+</p><p>Added portugese (brazilian) to languages. Thx to "Levi Fukumori". 
+</p><p>Removed arg3 parameter from Execute/SelectLimit/Cache* functions. 
+</p><p>Execute() now accepts 2-d array as $inputarray. Also changed docs of fnExecute() 
+  to note change in sql query counting with 2-d arrays. 
+</p><p>Added MONEY to MetaType in PostgreSQL. 
+</p><p>Added more debugging output to CacheFlush(). 
+</p><p><b>3.72 9 Aug 2003</b> 
+</p><p>Added qmagic($str), which is a qstr($str) that auto-checks for magic quotes 
+  and does the right thing... 
+</p><p>Fixed CacheFlush() bug - Thx to martin#gmx.de 
+</p><p>Walt Boring contributed MetaForeignKeys for postgres7. 
+</p><p>_fetch() called _BlobDecode() wrongly in interbase. Fixed. 
+</p><p>adodb_time bug fixed with dates after 2038 fixed by Jason Pell. http://phplens.com/lens/lensforum/msgs.php?id=6980 
+</p><p><b>3.71 4 Aug 2003</b> 
+</p><p>The oci8 driver, MetaPrimaryKeys() did not check the owner correctly when $owner 
+  == false. 
+</p><p>Russian language file contributed by "Cyrill Malevanov" cyrill#malevanov.spb.ru. 
+</p><p>Spanish language file contributed by "Horacio Degiorgi" horaciod#codigophp.com. 
+</p><p>Error handling in oci8 bugfix - if there was an error in Execute(), then when 
+  calling ErrorNo() and/or ErrorMsg(), the 1st call would return the error, but 
+  the 2nd call would return no error. 
+</p><p>Error handling in odbc bugfix. ODBC would always return the last error, even 
+  if it happened 5 queries ago. Now we reset the errormsg to '' and errorno to 
+  0 everytime before CacheExecute() and Execute(). 
+</p><p><b>3.70 29 July 2003</b> 
+</p><p>Added new SQLite driver. Tested on PHP 4.3 and PHP 5. 
+</p><p>Added limited "sapdb" driver support - mainly date support. 
+</p><p>The oci8 driver did not identify NUMBER with no defined precision correctly. 
+</p><p>Added ADODB_FORCE_NULLS, if set, then PHP nulls are converted to SQL nulls 
+  in GetInsertSQL/GetUpdateSQL. 
+</p><p>DBDate() and DBTimeStamp() format for postgresql had problems. Fixed. 
+</p><p>Added tableoptions to ChangeTableSQL(). Thx to Mike Benoit. 
+</p><p>Added charset support to postgresql. Thx to Julian Tarkhanov. 
+</p><p>Changed OS check for MS-Windows to prevent confusion with darWIN (MacOS) 
+</p><p>Timestamp format for db2 was wrong. Changed to yyyy-mm-dd-hh.mm.ss.nnnnnn. 
+</p><p>adodb-cryptsession.php includes wrong. Fixed. 
+</p><p>Added MetaForeignKeys(). Supported by mssql, odbc_mssql and oci8. 
+</p><p>Fixed some oci8 MetaColumns/MetaPrimaryKeys bugs. Thx to Walt Boring. 
+</p><p>adodb_getcount() did not init qryRecs to 0. Missing "WHERE" clause checking 
+  in GetUpdateSQL fixed. Thx to Sebastiaan van Stijn. 
+</p><p>Added support for only 'VIEWS' and "TABLES" in MetaTables. From Walt Boring. 
+</p><p>Upgraded to adodb-xmlschema.inc.php 0.0.2. 
+</p><p>NConnect for mysql now returns value. Thx to Dennis Verspuij. 
+</p><p>ADODB_FETCH_BOTH support added to interbase/firebird. 
+</p><p>Czech language file contributed by Kamil Jakubovic jake#host.sk. 
+</p><p>PostgreSQL BlobDecode did not use _connectionID properly. Thx to Juraj Chlebec. 
+</p><p>Added some new initialization stuff for Informix. Thx to "Andrea Pinnisi" pinnisi#sysnet.it 
+</p><p>ADODB_ASSOC_CASE constant wrong in sybase _fetch(). Fixed. 
+</p><p><b>3.60 16 June 2003</b> 
+</p><p>We now SET CONCAT_NULL_YIELDS_NULL OFF for odbc_mssql driver to be compat with 
+  mssql driver. 
+</p><p>The property $emptyDate missing from connection class. Also changed 1903 to 
+  constant (TIMESTAMP_FIRST_YEAR=100). Thx to Sebastiaan van Stijn. 
+</p><p>ADOdb speedup optimization - we now return all arrays by reference. 
+</p><p>Now DBDate() and DBTimeStamp() now accepts the string 'null' as a parameter. 
+  Suggested by vincent. 
+</p><p>Added GetArray() to connection class. 
+</p><p>Added not_null check in informix metacolumns(). 
+</p><p>Connection parameters for postgresql did not work correctly when port was defined. 
+</p><p>DB2 is now a tested driver, making adodb 100% compatible. Extensive changes 
+  to odbc driver for DB2, including implementing serverinfo() and SQLDate(), switching 
+  to SQL_CUR_USE_ODBC as the cursor mode, and lastAffectedRows and SelectLimit() 
+  fixes. 
+</p><p>The odbc driver's FetchField() field names did not obey ADODB_ASSOC_CASE. Fixed. 
+</p><p>Some bugs in adodb_backtrace() fixed. 
+</p><p>Added "INT IDENTITY" type to adorecordset::MetaType() to support odbc_mssql 
+  properly. 
+</p><p>MetaColumns() for oci8, mssql, odbc revised to support scale. Also minor revisions 
+  to odbc MetaColumns() for vfp and db2 compat. 
+</p><p>Added unsigned support to mysql datadict class. Thx to iamsure. 
+</p><p>Infinite loop in mssql MoveNext() fixed when ADODB_FETCH_ASSOC used. Thx to 
+  Josh R, Night_Wulfe#hotmail.com. 
+</p><p>ChangeTableSQL contributed by Florian Buzin. 
+</p><p>The odbc_mssql driver now sets CONCAT_NULL_YIELDS_NULL OFF for compat with 
+  mssql driver. 
+</p>
+
 <p><b>3.50 19 May 2003</b></p>
 <p>Fixed mssql compat with FreeTDS. FreeTDS does not implement mssql_fetch_assoc(). 
 <p>Merged back connection and recordset code into adodb.inc.php. 
@@ -697,4 +819,4 @@
 </p>
 <p><b>0.10 Sept 9 2000</b></p>
 <p>First release</p>
-<p>
\ No newline at end of file
+</body></html>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-access.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-access.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-access.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado5.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado5.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado5.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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 @@
   
   Latest version is available at http://adodb.sourceforge.net
   
-	Microsoft ADO data driver. Requires ADO. Works only on MS Windows.
+	Microsoft ADO data driver. Requires ADO. Works only on MS Windows. PHP5 compat version.
 */
 
 // security - hide paths

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_access.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_access.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_access.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_mssql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_mssql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ado_mssql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-borland_ibase.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-borland_ibase.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-borland_ibase.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-csv.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-csv.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-csv.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-db2.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-db2.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-db2.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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,8 +177,46 @@
 		}
 		return $arr2;
 	}
+
+	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
+	{
+        // save old fetch mode
+        global $ADODB_FETCH_MODE;
+        $save = $ADODB_FETCH_MODE;
+        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+        if ($this->fetchMode !== FALSE) {
+               $savem = $this->SetFetchMode(FALSE);
+        }
+		$false = false;
+		// get index details
+		$table = strtoupper($table);
+		$SQL="SELECT NAME, UNIQUERULE, COLNAMES FROM SYSIBM.SYSINDEXES WHERE TBNAME='$table'";
+        if ($primary) 
+			$SQL.= " AND UNIQUERULE='P'";
+		$rs = $this->Execute($SQL);
+        if (!is_object($rs)) {
+			if (isset($savem)) 
+				$this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+            return $false;
+        }
+		$indexes = array ();
+        // parse index data into array
+        while ($row = $rs->FetchRow()) {
+			$indexes[$row[0]] = array(
+			   'unique' => ($row[1] == 'U' || $row[1] == 'P'),
+			   'columns' => array()
+			);
+			$cols = ltrim($row[2],'+');
+			$indexes[$row[0]]['columns'] = explode('+', $cols);
+        }
+		if (isset($savem)) { 
+            $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+		}
+        return $indexes;
+	}
 	
-	
 	// Format date column in sql string given an input format that understands Y M D
 	function SQLDate($fmt, $col=false)
 	{	

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-fbsql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-fbsql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-fbsql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
- @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at 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,9 +170,10 @@
 		}
 		switch ($mode) {
 		case ADODB_FETCH_NUM: $this->fetchMode = FBSQL_NUM; break;
+		case ADODB_FETCH_ASSOC: $this->fetchMode = FBSQL_ASSOC; break;
+		case ADODB_FETCH_BOTH: 
 		default:
-		case ADODB_FETCH_BOTH: $this->fetchMode = FBSQL_BOTH; break;
-		case ADODB_FETCH_ASSOC: $this->fetchMode = FBSQL_ASSOC; break;
+		$this->fetchMode = FBSQL_BOTH; break;
 		}
 		return $this->ADORecordSet($queryID);
 	}

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-firebird.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-firebird.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-firebird.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ibase.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ibase.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ibase.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.  
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -52,6 +52,7 @@
 	var $hasAffectedRows = false;
 	var $poorAffectedRows = true;
 	var $blobEncodeType = 'C';
+	var $role = false;
 	
 	function ADODB_ibase() 
 	{
@@ -65,7 +66,11 @@
 		if (!function_exists('ibase_pconnect')) return null;
 		if ($argDatabasename) $argHostname .= ':'.$argDatabasename;
 		$fn = ($persist) ? 'ibase_pconnect':'ibase_connect';
-		$this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
+		if ($this->role)
+			$this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
+					$this->charSet,$this->buffers,$this->dialect,$this->role);
+		else	
+			$this->_connectionID = $fn($argHostname,$argUsername,$argPassword,
 					$this->charSet,$this->buffers,$this->dialect);
 		
 		if ($this->dialect != 1) { // http://www.ibphoenix.com/ibp_60_del_id_ds.html

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+* @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix72.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix72.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-informix72.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim. All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 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.
@@ -28,7 +28,7 @@
 	var $hasInsertID = true;
 	var $hasAffectedRows = true;
     var $substr = 'substr';
-	var $metaTablesSQL="select tabname from systables where tabtype!=' ' and owner!='informix'"; //Don't get informix tables and pseudo-tables
+	var $metaTablesSQL="select tabname,tabtype from systables where tabtype in ('T','V') and owner!='informix'"; //Don't get informix tables and pseudo-tables
 
 
 	var $metaColumnsSQL = 
@@ -141,7 +141,7 @@
 
 	function ErrorNo()
 	{
-		preg_match("/.*SQLCODE=([^\]]*)/",ifx_error(),$parse); //!EOS
+		preg_match("/.*SQLCODE=([^\]]*)/",ifx_error(),$parse);
 		if (is_array($parse) && isset($parse[1])) return (int)$parse[1]; 
 		return 0;
 	}
@@ -165,9 +165,20 @@
 			while (!$rs->EOF) { //print_r($rs->fields);
 				$fld = new ADOFieldObject();
 				$fld->name = $rs->fields[0];
+/*  //!eos.
+						$rs->fields[1] is not the correct adodb type
+						$rs->fields[2] is not correct max_length, because can include not-null bit
+
 				$fld->type = $rs->fields[1];
 				$fld->primary_key=$rspkey->fields && array_search($rs->fields[4],$rspkey->fields); //Added to set primary key flag
-				$fld->max_length = $rs->fields[2];
+				$fld->max_length = $rs->fields[2];*/
+				$pr=ifx_props($rs->fields[1],$rs->fields[2]); //!eos
+				$fld->type = $pr[0] ;//!eos
+				$fld->primary_key=$rspkey->fields && array_search($rs->fields[4],$rspkey->fields);
+				$fld->max_length = $pr[1]; //!eos
+				$fld->precision = $pr[2] ;//!eos
+				$fld->not_null = $pr[3]=="N"; //!eos
+
 				if (trim($rs->fields[3]) != "AAAAAA 0") {
 	                    		$fld->has_default = 1;
 	                    		$fld->default_value = $rs->fields[3];
@@ -180,6 +191,7 @@
 			}
 
 			$rs->Close();
+			$rspKey->Close(); //!eos
 			return $retarr;	
 		}
 
@@ -191,6 +203,38 @@
 		return ADOConnection::MetaColumns($table,false);
    }
 
+	 function MetaForeignKeys($table, $owner=false, $upper=false) //!Eos
+	{
+		$sql = "
+			select tr.tabname,updrule,delrule,
+			i.part1 o1,i2.part1 d1,i.part2 o2,i2.part2 d2,i.part3 o3,i2.part3 d3,i.part4 o4,i2.part4 d4,
+			i.part5 o5,i2.part5 d5,i.part6 o6,i2.part6 d6,i.part7 o7,i2.part7 d7,i.part8 o8,i2.part8 d8
+			from systables t,sysconstraints s,sysindexes i,
+			sysreferences r,systables tr,sysconstraints s2,sysindexes i2
+			where t.tabname='$table'
+			and s.tabid=t.tabid and s.constrtype='R' and r.constrid=s.constrid
+			and i.idxname=s.idxname and tr.tabid=r.ptabid
+			and s2.constrid=r.primary and i2.idxname=s2.idxname";
+
+		$rs = $this->Execute($sql);
+		if (!$rs || $rs->EOF)  return false;
+		$arr =& $rs->GetArray();
+		$a = array();
+		foreach($arr as $v) {
+			$coldest=$this->metaColumnNames($v["tabname"]);
+			$colorig=$this->metaColumnNames($table);
+			$colnames=array();
+			for($i=1;$i<=8 && $v["o$i"] ;$i++) {
+				$colnames[]=$coldest[$v["d$i"]-1]."=".$colorig[$v["o$i"]-1];
+			}
+			if($upper)
+				$a[strtoupper($v["tabname"])] =  $colnames;
+			else
+				$a[$v["tabname"]] =  $colnames;
+		}
+		return $a;
+	 }
+
    function UpdateBlob($table, $column, $val, $where, $blobtype = 'BLOB')
    {
    		$type = ($blobtype == 'TEXT') ? 1 : 0;
@@ -401,4 +445,29 @@
 	}
 
 }
+/** !Eos
+* Auxiliar function to Parse coltype,collength. Used by Metacolumns
+* return: array ($mtype,$length,$precision,$nullable) (similar to ifx_fieldpropierties)
+*/
+function ifx_props($coltype,$collength){
+	$itype=fmod($coltype+1,256);
+	$nullable=floor(($coltype+1) /256) ?"N":"Y";
+	$mtype=substr(" CIIFFNNDN TBXCC     ",$itype,1);
+	switch ($itype){
+		case 2:
+			$length=4;
+		case 6:
+		case 9:
+		case 14:
+			$length=floor($collength/256);
+			$precision=fmod($collength,256);
+			break;
+		default:
+			$precision=0;
+			$length=$collength;
+	}
+	return array($mtype,$length,$precision,$nullable);
+}
+
+
 ?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ldap.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ldap.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-ldap.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,11 +1,15 @@
 <?php
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 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.
   Set tabs to 8.
   
+  Revision 1: (02/25/2005) Updated codebase to include the _inject_bind_options function. This allows
+  users to access the options in the ldap_set_option function appropriately. Most importantly
+  LDAP Version 3 is now supported. See the examples for more information. Also fixed some minor
+  bugs that surfaced when PHP error levels were set high.
   
   Joshua Eldridge (joshuae74#hotmail.com)
 */ 
@@ -13,6 +17,12 @@
 // security - hide paths
 if (!defined('ADODB_DIR')) die();
 
+if (!defined('LDAP_ASSOC')) {
+	 define('LDAP_ASSOC',ADODB_FETCH_ASSOC);
+	 define('LDAP_NUM',ADODB_FETCH_NUM);
+	 define('LDAP_BOTH',ADODB_FETCH_BOTH);
+}
+
 class ADODB_ldap extends ADOConnection {
     var $databaseType = 'ldap';
 	var $dataProvider = 'ldap';
@@ -24,7 +34,10 @@
     # Used during searches
     var $filter;
     var $dn;
+	var $version;
 
+	# Options configuration information
+	var $LDAP_CONNECT_OPTIONS;
 
 	function ADODB_ldap() 
 	{		
@@ -36,6 +49,8 @@
 	function _connect( $host, $username, $password, $ldapbase )
 	{
 
+	global $LDAP_CONNECT_OPTIONS;
+
 	   if ( !function_exists( 'ldap_connect' ) ) return null;
 	   
 	   $conn_info = array( $host );
@@ -46,6 +61,11 @@
 
 	   $this->_connectionID = ldap_connect( $conn_info[0], $conn_info[1] ) 
 	       or die( 'Could not connect to ' . $this->_connectionID );
+
+	   if( count( $LDAP_CONNECT_OPTIONS ) > 0 ) {
+			$this->_inject_bind_options( $LDAP_CONNECT_OPTIONS );
+		}
+
 	   if ($username && $password) {
 	       $bind = ldap_bind( $this->_connectionID, $username, $password ) 
 	           or die( 'Could not bind to ' . $this->_connectionID . ' with $username & $password');
@@ -53,9 +73,68 @@
 	       $bind = ldap_bind( $this->_connectionID ) 
 	           or die( 'Could not bind anonymously to ' . $this->_connectionID );
 	   }
+	   $this->database = $ldapbase;
 	   return $this->_connectionID;
     }
     
+/*
+	Valid Domain Values for LDAP Options:
+
+	LDAP_OPT_DEREF (integer)
+	LDAP_OPT_SIZELIMIT (integer)
+	LDAP_OPT_TIMELIMIT (integer)
+	LDAP_OPT_PROTOCOL_VERSION (integer)
+	LDAP_OPT_ERROR_NUMBER (integer)
+	LDAP_OPT_REFERRALS (boolean)
+	LDAP_OPT_RESTART (boolean)
+	LDAP_OPT_HOST_NAME (string)
+	LDAP_OPT_ERROR_STRING (string)
+	LDAP_OPT_MATCHED_DN (string)
+	LDAP_OPT_SERVER_CONTROLS (array)
+	LDAP_OPT_CLIENT_CONTROLS (array)
+
+	Make sure to set this BEFORE calling Connect()
+
+	Example:
+
+	$LDAP_CONNECT_OPTIONS = Array(
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_DEREF,
+			"OPTION_VALUE"=>2
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_SIZELIMIT,
+			"OPTION_VALUE"=>100
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_TIMELIMIT,
+			"OPTION_VALUE"=>30
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_PROTOCOL_VERSION,
+			"OPTION_VALUE"=>3
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_ERROR_NUMBER,
+			"OPTION_VALUE"=>13
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_REFERRALS,
+			"OPTION_VALUE"=>FALSE
+		),
+		Array (
+			"OPTION_NAME"=>LDAP_OPT_RESTART,
+			"OPTION_VALUE"=>FALSE
+		)
+	);
+*/
+
+	function _inject_bind_options( $options ) {
+		foreach( $options as $option ) {
+			ldap_set_option( $this->_connectionID, $option["OPTION_NAME"], $option["OPTION_VALUE"] )
+				or die( "Unable to set server option: " . $option["OPTION_NAME"] );
+		}
+	}
 	
 	/* returns _queryID or false */
 	function _query($sql,$inputarr)
@@ -72,9 +151,14 @@
 		$this->_connectionID = false;
 	}
     
+	function SelectDB($db) {
+		$this->database = $db;
+		return true;
+	} // SelectDB
+
     function ServerInfo()
     {
-        if( is_array( $this->version ) ) return $this->version;
+        if( !empty( $this->version ) ) return $this->version;
         $version = array();
         /*
         Determines how aliases are handled during search. 
@@ -160,8 +244,8 @@
         }
         /* The host name (or list of hosts) for the primary LDAP server. */
         ldap_get_option( $this->_connectionID, LDAP_OPT_HOST_NAME, $version['LDAP_OPT_HOST_NAME'] ); 
-        ldap_get_option( $this->_connectionID, OPT_ERROR_NUMBER, $version['OPT_ERROR_NUMBER'] ); 
-        ldap_get_option( $this->_connectionID, OPT_ERROR_STRING, $version['OPT_ERROR_STRING'] ); 
+        ldap_get_option( $this->_connectionID, LDAP_OPT_ERROR_NUMBER, $version['LDAP_OPT_ERROR_NUMBER'] ); 
+        ldap_get_option( $this->_connectionID, LDAP_OPT_ERROR_STRING, $version['LDAP_OPT_ERROR_STRING'] ); 
         ldap_get_option( $this->_connectionID, LDAP_OPT_MATCHED_DN, $version['LDAP_OPT_MATCHED_DN'] ); 
         
         return $this->version = $version;
@@ -193,9 +277,9 @@
 		case ADODB_FETCH_ASSOC: 
 		  $this->fetchMode = LDAP_ASSOC; 
 		break;
-		default:
 		case ADODB_FETCH_DEFAULT:
 		case ADODB_FETCH_BOTH: 
+		default:
 		  $this->fetchMode = LDAP_BOTH; 
 		break;
 		}
@@ -292,11 +376,12 @@
             break;
             
             case LDAP_NUM:
-            $this->fields = $this->GetRowNums();
+			$this->fields = array_merge($this->GetRowNums(),$this->GetRowAssoc());
             break;
             
             case LDAP_BOTH:
             default:
+			$this->fields = $this->GetRowNums();
             break;
         }
         return ( is_array( $this->fields ) );        

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
@@ -535,6 +535,30 @@
 		return array($sql,$stmt);
 	}
 	
+	// returns concatenated string
+    // MSSQL requires integers to be cast as strings
+    // automatically cast every datatype to VARCHAR(255)
+    // @author David Rogers (introspectshun)
+    function Concat()
+    {
+            $s = "";
+            $arr = func_get_args();
+
+            // Split single record on commas, if possible
+            if (sizeof($arr) == 1) {
+                foreach ($arr as $arg) {
+                    $args = explode(',', $arg);
+                }
+                $arr = $args;
+            }
+
+            array_walk($arr, create_function('&$v', '$v = "CAST(" . $v . " AS VARCHAR(255))";'));
+            $s = implode('+',$arr);
+            if (sizeof($arr) > 0) return "$s";
+            
+			return '';
+    }
+	
 	/* 
 	Usage:
 		$stmt = $db->PrepareSP('SP_RUNSOMETHING'); -- takes 2 params, @myid and @group

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssqlpo.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssqlpo.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mssqlpo.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+* @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -149,7 +149,8 @@
 	
 	function _insertid()
 	{
-		return mysql_insert_id($this->_connectionID);
+		return ADOConnection::GetOne('SELECT LAST_INSERT_ID()');
+		//return mysql_insert_id($this->_connectionID);
 	}
 	
 	function GetOne($sql,$inputarr=false)
@@ -303,7 +304,13 @@
 				$s .= '%p';
 				break;
 				
-
+			case 'w':
+				$s .= '%w';
+				break;
+				
+			case 'l':
+				$s .= '%W';
+				break;
 			}
 		}
 		$s.="')";
@@ -341,17 +348,7 @@
 			$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
 												$this->forceNewConnect);
 		else
-			$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
-			
-        /** hack to adodb **/
-		if ($this->_isSupportUtf8() && $argDatabasename) {
-			$dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
-			if ($dbEncoding) {
-				mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
-			}
-		}
-		/** end of hack **/
-			
+			$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
 	
 		if ($this->_connectionID === false) return false;
 		if ($argDatabasename) return $this->SelectDB($argDatabasename);
@@ -366,17 +363,7 @@
 		else
 			$this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
 		if ($this->_connectionID === false) return false;
-		if ($this->autoRollback) $this->RollbackTrans();
-		
-        /** hack to adodb **/
-		if ($this->_isSupportUtf8() && $argDatabasename) {
-			$dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
-			if ($dbEncoding) {
-				mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
-			}
-		}		
-		/** end of hack **/		
-		
+		if ($this->autoRollback) $this->RollbackTrans();
 		if ($argDatabasename) return $this->SelectDB($argDatabasename);
 		return true;	
 	}
@@ -385,51 +372,10 @@
 	{
 		$this->forceNewConnect = true;
 		return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
-	}
-    
-    /** start of adodb hack **/
-	function _isSupportUtf8() {
-	
-		// check mysql version first. Version lower than 4.1 doesn't support utf8
-		$serverVersion = mysql_get_server_info($this->_connectionID);
-		$version = explode('.', $serverVersion);
-		if ($version[0] < 4) return false;
-		if ( ($version[0] == 4) && ($version[1] == 0) ) return false;
-		
-		// check if utf8 support was compiled in
-		$result = mysql_query("SHOW CHARACTER SET like 'utf8'", $this->_connectionID);
-		if (mysql_num_rows($result) > 0) {
-			return true;
-		}
-		return false;
-	}
-	
-	function _getDbDefaultEncoding($argDatabasename)
-	{
-		
-		if (!$argDatabasename) {
-			return false;
-		}
-		
-		// We use a SHOW CREATE DATABASE command to show the original
-		// SQL character set when DB was created.
-		$result = mysql_query("SHOW CREATE DATABASE $argDatabasename", $this->_connectionID);
-		if (mysql_num_rows($result) < 0 ) {
-			// The specified db name is wrong!
-			return false;
-		}
-		$dbInfo = mysql_fetch_row($result);
-		$pattern = '/40100 DEFAULT CHARACTER SET (\w+) /';
-		if ( (preg_match($pattern, $dbInfo[1], $match) > 0) ) {
-			return $match[1];
-		}
-		return false;
-    }
-    /** end of hack **/
+	}
 	
  	function &MetaColumns($table) 
 	{
-	
 		global $ADODB_FETCH_MODE;
 		$save = $ADODB_FETCH_MODE;
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
@@ -457,6 +403,10 @@
 			} 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];
+				$fld->max_length = max(array_map("strlen",explode(",",$query_array[2]))) - 2; // PHP >= 4.0.6
+				$fld->max_length = ($fld->max_length == 0 ? 1 : $fld->max_length);
 			} else {
 				$fld->type = $type;
 				$fld->max_length = -1;
@@ -586,9 +536,10 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default:
+			$this->fetchMode = MYSQL_BOTH; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);	
@@ -741,9 +692,10 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default:
+		$this->fetchMode = MYSQL_BOTH; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqli.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqli.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqli.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -18,6 +18,8 @@
 
 if (! defined("_ADODB_MYSQLI_LAYER")) {
  define("_ADODB_MYSQLI_LAYER", 1 );
+ 
+ if (!defined('MYSQLI_READ_DEFAULT_GROUP')) define('MYSQLI_READ_DEFAULT_GROUP',1);
 
  // disable adodb extension - currently incompatible.
  global $ADODB_EXTENSION; $ADODB_EXTENSION = false;
@@ -36,7 +38,7 @@
 	var $isoDates = true; // accepts dates in ISO format
 	var $sysDate = 'CURDATE()';
 	var $sysTimeStamp = 'NOW()';
-	var $hasTransactions = false;
+	var $hasTransactions = true;
 	var $forceNewConnect = false;
 	var $poorAffectedRows = true;
 	var $clientFlags = 0;
@@ -45,11 +47,12 @@
 	var $socket = false;
 	var $_bindInputArray = false;
 	var $nameQuote = '`';		/// string to use to quote identifiers and names
+	var $optionFlags = array(array(MYSQLI_READ_DEFAULT_GROUP,0));
 	
 	function ADODB_mysqli() 
 	{			
-	  if(!extension_loaded("mysqli"))
-	      trigger_error("You must have the mysqli extension installed.", E_USER_ERROR);
+	 // if(!extension_loaded("mysqli"))
+	      ;//trigger_error("You must have the mysqli extension installed.", E_USER_ERROR);
 	    
 	}
 	
@@ -62,6 +65,9 @@
 			  $argPassword = NULL, 
 			  $argDatabasename = NULL, $persist=false)
 	  {
+	  	 if(!extension_loaded("mysqli")) {
+			return null;
+		 }
 	    $this->_connectionID = @mysqli_init();
 	    
 	    if (is_null($this->_connectionID)) {
@@ -70,9 +76,15 @@
 				ADOConnection::outp("mysqli_init() failed : "  . $this->ErrorMsg());
 	      return false;
 	    }
-	    // Set connection options
-	    // Not implemented now
-	    // mysqli_options($this->_connection,,);
+		/*
+		I suggest a simple fix which would enable adodb and mysqli driver to
+		read connection options from the standard mysql configuration file
+		/etc/my.cnf - "Bastien Duclaux" <bduclaux#yahoo.com>
+		*/
+		foreach($this->optionFlags as $arr) {	
+			mysqli_options($this->_connectionID,$arr[0],$arr[1]);
+		}
+		
  	    if (mysqli_real_connect($this->_connectionID,
  				    $argHostname,
  				    $argUsername,
@@ -107,7 +119,7 @@
 	function _nconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
 	  {
 	    $this->forceNewConnect = true;
-	    $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
+	    return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
 	  }
 	
 	function IfNull( $field, $ifNull ) 
@@ -386,6 +398,22 @@
 		return "from_unixtime(unix_timestamp($date)+($dayFraction)*24*3600)";
 	}
 	
+	function &MetaTables($ttype=false,$showSchema=false,$mask=false) 
+	{	
+		$save = $this->metaTablesSQL;
+		if ($showSchema && is_string($showSchema)) {
+			$this->metaTablesSQL .= " from $showSchema";
+		}
+		
+		if ($mask) {
+			$mask = $this->qstr($mask);
+			$this->metaTablesSQL .= " like $mask";
+		}
+		$ret =& ADOConnection::MetaTables($ttype,$showSchema);
+		
+		$this->metaTablesSQL = $save;
+		return $ret;
+	}
 	
  	function &MetaColumns($table) 
 	{
@@ -418,6 +446,10 @@
 			} 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];
+				$fld->max_length = max(array_map("strlen",explode(",",$query_array[2]))) - 2; // PHP >= 4.0.6
+				$fld->max_length = ($fld->max_length == 0 ? 1 : $fld->max_length);
 			} else {
 				$fld->type = $type;
 				$fld->max_length = -1;
@@ -529,7 +561,7 @@
 	function ErrorMsg() 
 	  {
 	    if (empty($this->_connectionID)) 
-	      $this->_errorMsg = @mysqli_error();
+	      $this->_errorMsg = @mysqli_connect_error();
 	    else 
 	      $this->_errorMsg = @mysqli_error($this->_connectionID);
 	    return $this->_errorMsg;
@@ -539,7 +571,7 @@
 	function ErrorNo() 
 	  {
 	    if (empty($this->_connectionID))  
-	      return @mysqli_errno();
+	      return @mysqli_connect_errno();
 	    else 
 	      return @mysqli_errno($this->_connectionID);
 	  }
@@ -726,13 +758,13 @@
 		
 		 $len = -1; // mysql max_length is not accurate
 		 switch (strtoupper($t)) {
-		/* case 'STRING': 
+		 case 'STRING': 
 		 case 'CHAR':
 		 case 'VARCHAR': 
 		 case 'TINYBLOB': 
 		 case 'TINYTEXT': 
 		 case 'ENUM': 
-		 case 'SET': */
+		 case 'SET': 
 		
 		case MYSQLI_TYPE_TINY_BLOB :
 		case MYSQLI_TYPE_CHAR :
@@ -742,34 +774,34 @@
 		case 253 :
 		   if ($len <= $this->blobSize) return 'C';
 		   
-		/*case 'TEXT':
+		case 'TEXT':
 		case 'LONGTEXT': 
-		case 'MEDIUMTEXT':*/
+		case 'MEDIUMTEXT':
 		   return 'X';
 		
 		
 		   // php_mysql extension always returns 'blob' even if 'text'
 		   // so we have to check whether binary...
-		/*case 'IMAGE':
+		case 'IMAGE':
 		case 'LONGBLOB': 
 		case 'BLOB':
-		case 'MEDIUMBLOB':*/
+		case 'MEDIUMBLOB':
 		
 		case MYSQLI_TYPE_BLOB :
 		case MYSQLI_TYPE_LONG_BLOB :
 		case MYSQLI_TYPE_MEDIUM_BLOB :
 		
 		   return !empty($fieldobj->binary) ? 'B' : 'X';
-		/*case 'YEAR':
-		case 'DATE': */
+		case 'YEAR':
+		case 'DATE': 
 		case MYSQLI_TYPE_DATE :
 		case MYSQLI_TYPE_YEAR :
 		
 		   return 'D';
 		
-		/*case 'TIME':
+		case 'TIME':
 		case 'DATETIME':
-		case 'TIMESTAMP':*/
+		case 'TIMESTAMP':
 		
 		case MYSQLI_TYPE_DATETIME :
 		case MYSQLI_TYPE_NEWDATE :
@@ -778,13 +810,13 @@
 		
 			return 'T';
 		
-		/*case 'INT': 
+		case 'INT': 
 		case 'INTEGER':
 		case 'BIGINT':
 		case 'TINYINT':
 		case 'MEDIUMINT':
 		case 'SMALLINT': 
-		*/
+		
 		case MYSQLI_TYPE_INT24 :
 		case MYSQLI_TYPE_LONG :
 		case MYSQLI_TYPE_LONGLONG :
@@ -795,7 +827,7 @@
 		   
 		   return 'I';
 		
-		/*
+		
 		   // Added floating-point types
 		   // Maybe not necessery.
 		 case 'FLOAT':
@@ -803,9 +835,9 @@
 		   //		case 'DOUBLE PRECISION':
 		 case 'DECIMAL':
 		 case 'DEC':
-		 case 'FIXED':*/
+		 case 'FIXED':
 		 default:
-		 	if (!is_numeric($t)) echo "<p>--- Error in type matching $t -----</p>"; 
+		 	//if (!is_numeric($t)) echo "<p>--- Error in type matching $t -----</p>"; 
 		 	return 'N';
 		}
 	} // function

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqlt.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqlt.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-mysqlt.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -74,11 +74,13 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: $this->fetchMode = MYSQL_BOTH; break;
 		}
 	
+		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);	
 	}
 	
@@ -108,9 +110,11 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = MYSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = MYSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = MYSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: 
+			$this->fetchMode = MYSQL_BOTH; break;
 		}
 	
 		$this->ADORecordSet($queryID);	

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-netezza.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-netezza.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-netezza.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 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.
@@ -149,10 +149,12 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = PGSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: $this->fetchMode = PGSQL_BOTH; break;
 		}
+		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);
 	}
 	

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 /*
 
-  version V4.54 5 Nov 2004 (c) 2000-2004 John Lim. All rights reserved.
+  version V4.62 2 Apr 2005 (c) 2000-2005 John Lim. All rights reserved.
 
   Released under both BSD license and Lesser GPL library license. 
   Whenever there is any discrepancy between the two licenses, 
@@ -99,6 +99,7 @@
 	{
 	global $ADODB_FETCH_MODE;
 	
+		$false = false;
 		$save = $ADODB_FETCH_MODE;
 		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
 		if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
@@ -108,7 +109,6 @@
 		if (isset($savem)) $this->SetFetchMode($savem);
 		$ADODB_FETCH_MODE = $save;
 		if (!$rs) {
-			$false = false;
 			return $false;
 		}
 		$retarr = array();
@@ -131,7 +131,7 @@
 			$rs->MoveNext();
 		}
 		$rs->Close();
-		return $retarr;
+		return (empty($retarr)) ? $false : $retarr;
 	}
 	
 	function Time()
@@ -305,6 +305,73 @@
 		return $ret;
 	}
 	
+	// Mark Newnham 
+	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
+	{
+        // save old fetch mode
+        global $ADODB_FETCH_MODE;
+
+        $save = $ADODB_FETCH_MODE;
+        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+
+        if ($this->fetchMode !== FALSE) {
+               $savem = $this->SetFetchMode(FALSE);
+        }
+
+		// get index details
+		$table = strtoupper($table);
+
+		// get Primary index
+		$primary_key = '';
+
+		$false = false;
+		$rs = $this->Execute(sprintf("SELECT * FROM ALL_CONSTRAINTS WHERE UPPER(TABLE_NAME)='%s' AND CONSTRAINT_TYPE='P'",$table));
+		if ($row = $rs->FetchRow())
+		   $primary_key = $row[1]; //constraint_name
+
+		if ($primary==TRUE && $primary_key=='') {
+			 if (isset($savem)) 
+                $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+			return $false; //There is no primary key
+		}
+
+        $rs = $this->Execute(sprintf("SELECT ALL_INDEXES.INDEX_NAME, ALL_INDEXES.UNIQUENESS, ALL_IND_COLUMNS.COLUMN_POSITION, ALL_IND_COLUMNS.COLUMN_NAME FROM ALL_INDEXES,ALL_IND_COLUMNS WHERE UPPER(ALL_INDEXES.TABLE_NAME)='%s' AND ALL_IND_COLUMNS.INDEX_NAME=ALL_INDEXES.INDEX_NAME",$table));
+
+		
+        if (!is_object($rs)) {
+			if (isset($savem)) 
+				$this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+            return $false;
+        }
+
+		$indexes = array ();
+        // parse index data into array
+
+        while ($row = $rs->FetchRow()) {
+			if ($primary && $row[0] != $primary_key) continue;
+            if (!isset($indexes[$row[0]])) {
+				$indexes[$row[0]] = array(
+				   'unique' => ($row[1] == 'UNIQUE'),
+				   'columns' => array()
+				);
+            }
+            $indexes[$row[0]]['columns'][$row[2] - 1] = $row[3];
+        }
+
+        // sort columns by order in the index
+        foreach ( array_keys ($indexes) as $index ) {
+            ksort ($indexes[$index]['columns']);
+        }
+
+		if (isset($savem)) { 
+            $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+		}
+        return $indexes;
+	}
+	
 	function BeginTrans()
 	{	
 		if ($this->transOff) return true;
@@ -426,6 +493,14 @@
 				$s .= 'AM';
 				break;
 				
+			case 'w':
+				$s .= 'D';
+				break;
+				
+			case 'l':
+				$s .= 'DAY';
+				break;
+				
 			default:
 			// handle escape characters...
 				if ($ch == '\\') {
@@ -655,8 +730,7 @@
 	}
 	
 	/*
-		Call an oracle stored procedure and return a cursor variable. 
-		Convert the cursor variable into a recordset. 
+		Call an oracle stored procedure and returns a cursor variable as a recordset. 
 		Concept by Robert Tuttle robert at ud.com
 		
 		Example:
@@ -673,16 +747,22 @@
 	{
 		if (is_array($sql)) $stmt = $sql;
 		else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate OCINewCursor
-			
+	
 		if (is_array($stmt) && sizeof($stmt) >= 5) {
+			$hasref = true;
 			$this->Parameter($stmt, $ignoreCur, $cursorName, false, -1, OCI_B_CURSOR);
 			if ($params) {
 				foreach($params as $k => $v) {
 					$this->Parameter($stmt,$params[$k], $k);
 				}
 			}
-		}
-		return $this->Execute($stmt);
+		} else
+			$hasref = false;
+			
+		$rs =& $this->Execute($stmt);
+		if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
+		else if ($hasref) $rs->_refcursor = $stmt[4];
+		return $rs;
 	}
 	
 	/*
@@ -733,25 +813,26 @@
 				ADOConnection::outp("<b>Bind</b>: name = $name");
 			}
             //we have to create a new Descriptor here
-			$numlob = count($this -> _refLOBs);
-        	$this -> _refLOBs[$numlob]['LOB'] = OCINewDescriptor($this->_connectionID, oci_lob_desc($type));
-			$this -> _refLOBs[$numlob]['TYPE'] = $isOutput;
+			$numlob = count($this->_refLOBs);
+        	$this->_refLOBs[$numlob]['LOB'] = OCINewDescriptor($this->_connectionID, oci_lob_desc($type));
+			$this->_refLOBs[$numlob]['TYPE'] = $isOutput;
 			
-			$tmp = &$this -> _refLOBs[$numlob]['LOB'];
+			$tmp = &$this->_refLOBs[$numlob]['LOB'];
 	        $rez = OCIBindByName($stmt[1], ":".$name, $tmp, -1, $type);
 			if ($this->debug) {
-				ADOConnection::outp("<b>Bind</b>: descriptor has been allocated, var binded");
+				ADOConnection::outp("<b>Bind</b>: descriptor has been allocated, var (".$name.") binded");
 			}
 			
 			// if type is input then write data to lob now
 			if ($isOutput == false) {
-				$var = $this -> BlobEncode($var);
-				$tmp -> WriteTemporary($var);
+				$var = $this->BlobEncode($var);
+				$tmp->WriteTemporary($var);
+				$this->_refLOBs[$numlob]['VAR'] = &$var;
 				if ($this->debug) {
 					ADOConnection::outp("<b>Bind</b>: LOB has been written to temp");
 				}
 			} else {
-				$this -> _refLOBs[$numlob]['VAR'] = &$var;
+				$this->_refLOBs[$numlob]['VAR'] = &$var;
 			}
 			$rez = $tmp;
 		} else {
@@ -829,7 +910,7 @@
 					$bindarr = array();
 					foreach($inputarr as $k => $v) {
 						$bindarr[$k] = $v;
-						OCIBindByName($stmt,":$k",$bindarr[$k],4000);
+						OCIBindByName($stmt,":$k",$bindarr[$k],is_string($v) && strlen($v)>4000 ? -1 : 4000);
 					}
 					$this->_bind[$bindpos] = &$bindarr;
 				}
@@ -878,9 +959,14 @@
 						}
 						//$_GLOBALS[$this -> _refLOBs[$key]['VAR']] = $tmp;
 						$this -> _refLOBs[$key]['VAR'] = $tmp;
-					}
-					$this -> _refLOBs[$key]['LOB'] -> free();
-					unset($this -> _refLOBs[$key]);
+					} else {
+                        $this->_refLOBs[$key]['LOB']->save($this->_refLOBs[$key]['VAR']);
+						$this -> _refLOBs[$key]['LOB']->free();
+						unset($this -> _refLOBs[$key]);
+                        if ($this->debug) {
+							ADOConnection::outp("<b>IN LOB</b>: LOB has been saved. <br>");
+						}
+                    }					
 				}
 			}
 		
@@ -919,10 +1005,10 @@
 		if (!$this->_connectionID) return;
 		
 		if (!$this->autoCommit) OCIRollback($this->_connectionID);
-		if (count($this -> _refLOBs) > 0) {
-			foreach ($this -> _refLOBs as $key => $value) {
-				$this -> _refLOBs[$key] -> free();
-				unset($this -> _refLOBs[$key]);
+		if (count($this->_refLOBs) > 0) {
+			foreach ($this ->_refLOBs as $key => $value) {
+				$this->_refLOBs[$key]['LOB']->free();
+				unset($this->_refLOBs[$key]);
 			}
 		}
 		OCILogoff($this->_connectionID);
@@ -1057,6 +1143,7 @@
 	var $databaseType = 'oci8';
 	var $bind=false;
 	var $_fieldobjs;
+	
 	//var $_arr = false;
 		
 	function ADORecordset_oci8($queryID,$mode=false)
@@ -1067,11 +1154,12 @@
 		}
 		switch ($mode)
 		{
-		default:
-		case ADODB_FETCH_NUM: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_DEFAULT:
 		case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
+		case ADODB_FETCH_NUM: 
+		default:
+		$this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		}
 		
 		$this->adodbFetchMode = $mode;
@@ -1233,6 +1321,10 @@
 	function _close() 
 	{
 		if ($this->connection->_stmt === $this->_queryID) $this->connection->_stmt = false;
+		if (!empty($this->_refcursor)) {
+			OCIFreeCursor($this->_refcursor);
+			$this->_refcursor = false;
+		}
 		@OCIFreeStatement($this->_queryID);
  		$this->_queryID = false;
 		
@@ -1292,11 +1384,11 @@
 		}
 		switch ($mode)
 		{
-		default:
-		case ADODB_FETCH_NUM: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		case ADODB_FETCH_DEFAULT:
 		case ADODB_FETCH_BOTH:$this->fetchMode = OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
+		case ADODB_FETCH_NUM: 
+		default: $this->fetchMode = OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->_queryID = $queryID;

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci805.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci805.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci805.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8po.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8po.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oci8po.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim. All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_mssql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_mssql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_mssql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
@@ -43,7 +43,7 @@
 	function ADODB_odbc_mssql()
 	{
 		$this->ADODB_odbc();
-		$this->curmode = SQL_CUR_USE_ODBC;	
+		//$this->curmode = SQL_CUR_USE_ODBC;	
 	}
 
 	// crashes php...

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_oracle.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_oracle.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbc_oracle.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-odbtp_unicode.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-	V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+	V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oracle.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oracle.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-oracle.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-pdo.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-pdo.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-pdo.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim#natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 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. 
@@ -9,14 +9,290 @@
   Latest version is available at http://adodb.sourceforge.net
   
   Requires ODBC. Works on Windows and Unix.
+
+	Problems: 
+		Where is float/decimal type in pdo_param_type
+		LOB handling for CLOB/BLOB differs significantly
 */
 // security - hide paths
 if (!defined('ADODB_DIR')) die();
+
+
+/*
+enum pdo_param_type {
+PDO_PARAM_NULL, 0
+
+/* int as in long (the php native int type).
+ * If you mark a column as an int, PDO expects get_col to return
+ * a pointer to a long 
+PDO_PARAM_INT, 1
+
+/* get_col ptr should point to start of the string buffer 
+PDO_PARAM_STR, 2
+
+/* get_col: when len is 0 ptr should point to a php_stream *,
+ * otherwise it should behave like a string. Indicate a NULL field
+ * value by setting the ptr to NULL 
+PDO_PARAM_LOB, 3
+
+/* get_col: will expect the ptr to point to a new PDOStatement object handle,
+ * but this isn't wired up yet 
+PDO_PARAM_STMT, 4 /* hierarchical result set 
+
+/* get_col ptr should point to a zend_bool 
+PDO_PARAM_BOOL, 5
+
+
+/* magic flag to denote a parameter as being input/output 
+PDO_PARAM_INPUT_OUTPUT = 0x80000000
+};
+*/
+	
+function adodb_pdo_type($t)
+{
+	switch($t) {
+	case 2: return 'VARCHAR';
+	case 3: return 'BLOB';
+	default: return 'NUMERIC';
+	}
+}
 	 
 /*--------------------------------------------------------------------------------------
 --------------------------------------------------------------------------------------*/
 
 
+class ADODB_pdo_pgsql extends ADODB_pdo {
+var $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1";
+    var $metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
+	and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages',
+	 'sql_packages', 'sql_sizing', 'sql_sizing_profiles') 
+	union 
+        select viewname,'V' from pg_views where viewname not like 'pg\_%'";
+	//"select tablename from pg_tables where tablename not like 'pg_%' order by 1";
+	var $isoDates = true; // accepts dates in ISO format
+	var $sysDate = "CURRENT_DATE";
+	var $sysTimeStamp = "CURRENT_TIMESTAMP";
+	var $blobEncodeType = 'C';
+	var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum 
+		FROM pg_class c, pg_attribute a,pg_type t 
+		WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
+AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
+
+	// used when schema defined
+	var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum 
+FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n 
+WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
+ and c.relnamespace=n.oid and n.nspname='%s' 
+	and a.attname not like '....%%' AND a.attnum > 0 
+	AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
+	
+	// get primary key etc -- from Freek Dijkstra
+	var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key 
+	FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'";
+	
+	var $hasAffectedRows = true;
+	var $hasLimit = false;	// set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
+	// below suggested by Freek Dijkstra 
+	var $true = 't';		// string that represents TRUE for a database
+	var $false = 'f';		// string that represents FALSE for a database
+	var $fmtDate = "'Y-m-d'";	// used by DBDate() as the default date format used by the database
+	var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
+	var $hasMoveFirst = true;
+	var $hasGenID = true;
+	var $_genIDSQL = "SELECT NEXTVAL('%s')";
+	var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
+	var $_dropSeqSQL = "DROP SEQUENCE %s";
+	var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
+	var $random = 'random()';		/// random function
+	var $concat_operator='||';
+	 
+	function ServerInfo()
+	{
+		$arr['description'] = ADOConnection::GetOne("select version()");
+		$arr['version'] = ADOConnection::_findvers($arr['description']);
+		return $arr;
+	}
+	
+	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0) 
+	{
+		 $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
+		 $limitStr  = ($nrows >= 0)  ? " LIMIT $nrows" : '';
+		 if ($secs2cache)
+		  	$rs =& $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
+		 else
+		  	$rs =& $this->Execute($sql."$limitStr$offsetStr",$inputarr);
+		
+		return $rs;
+	}
+	
+	function &MetaTables($ttype=false,$showSchema=false,$mask=false) 
+	{
+		$info = $this->ServerInfo();
+		if ($info['version'] >= 7.3) {
+	    	$this->metaTablesSQL = "select tablename,'T' from pg_tables where tablename not like 'pg\_%'
+			  and schemaname  not in ( 'pg_catalog','information_schema')
+	union 
+        select viewname,'V' from pg_views where viewname not like 'pg\_%'  and schemaname  not in ( 'pg_catalog','information_schema') ";
+		}
+		if ($mask) {
+			$save = $this->metaTablesSQL;
+			$mask = $this->qstr(strtolower($mask));
+			if ($info['version']>=7.3)
+				$this->metaTablesSQL = "
+select tablename,'T' from pg_tables where tablename like $mask and schemaname not in ( 'pg_catalog','information_schema')  
+ union 
+select viewname,'V' from pg_views where viewname like $mask and schemaname  not in ( 'pg_catalog','information_schema')  ";
+			else
+				$this->metaTablesSQL = "
+select tablename,'T' from pg_tables where tablename like $mask 
+ union 
+select viewname,'V' from pg_views where viewname like $mask";
+		}
+		$ret =& ADOConnection::MetaTables($ttype,$showSchema);
+		
+		if ($mask) {
+			$this->metaTablesSQL = $save;
+		}
+		return $ret;
+	}
+	
+function &MetaColumns($table,$normalize=true) 
+	{
+	global $ADODB_FETCH_MODE;
+	
+		$schema = false;
+		$this->_findschema($table,$schema);
+		
+		if ($normalize) $table = strtolower($table);
+
+		$save = $ADODB_FETCH_MODE;
+		$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+		if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
+		
+		if ($schema) $rs =& $this->Execute(sprintf($this->metaColumnsSQL1,$table,$table,$schema));
+		else $rs =& $this->Execute(sprintf($this->metaColumnsSQL,$table,$table));
+		if (isset($savem)) $this->SetFetchMode($savem);
+		$ADODB_FETCH_MODE = $save;
+		
+		if ($rs === false) {
+			$false = false;
+			return $false;
+		}
+		if (!empty($this->metaKeySQL)) {
+			// If we want the primary keys, we have to issue a separate query
+			// Of course, a modified version of the metaColumnsSQL query using a 
+			// LEFT JOIN would have been much more elegant, but postgres does 
+			// not support OUTER JOINS. So here is the clumsy way.
+			
+			$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+			
+			$rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));
+			// fetch all result in once for performance.
+			$keys =& $rskey->GetArray();
+			if (isset($savem)) $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+			
+			$rskey->Close();
+			unset($rskey);
+		}
+
+		$rsdefa = array();
+		if (!empty($this->metaDefaultsSQL)) {
+			$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+			$sql = sprintf($this->metaDefaultsSQL, ($table));
+			$rsdef = $this->Execute($sql);
+			if (isset($savem)) $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+			
+			if ($rsdef) {
+				while (!$rsdef->EOF) {
+					$num = $rsdef->fields['num'];
+					$s = $rsdef->fields['def'];
+					if (strpos($s,'::')===false && substr($s, 0, 1) == "'") { /* quoted strings hack... for now... fixme */
+						$s = substr($s, 1);
+						$s = substr($s, 0, strlen($s) - 1);
+					}
+
+					$rsdefa[$num] = $s;
+					$rsdef->MoveNext();
+				}
+			} else {
+				ADOConnection::outp( "==> SQL => " . $sql);
+			}
+			unset($rsdef);
+		}
+	
+		$retarr = array();
+		while (!$rs->EOF) { 	
+			$fld = new ADOFieldObject();
+			$fld->name = $rs->fields[0];
+			$fld->type = $rs->fields[1];
+			$fld->max_length = $rs->fields[2];
+			if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
+			if ($fld->max_length <= 0) $fld->max_length = -1;
+			if ($fld->type == 'numeric') {
+				$fld->scale = $fld->max_length & 0xFFFF;
+				$fld->max_length >>= 16;
+			}
+			// dannym
+			// 5 hasdefault; 6 num-of-column
+			$fld->has_default = ($rs->fields[5] == 't');
+			if ($fld->has_default) {
+				$fld->default_value = $rsdefa[$rs->fields[6]];
+			}
+
+			//Freek
+			if ($rs->fields[4] == $this->true) {
+				$fld->not_null = true;
+			}
+			
+			// Freek
+			if (is_array($keys)) {
+				foreach($keys as $key) {
+					if ($fld->name == $key['column_name'] AND $key['primary_key'] == $this->true) 
+						$fld->primary_key = true;
+					if ($fld->name == $key['column_name'] AND $key['unique_key'] == $this->true) 
+						$fld->unique = true; // What name is more compatible?
+				}
+			}
+			
+			if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;	
+			else $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;
+			
+			$rs->MoveNext();
+		}
+		$rs->Close();
+		return empty($retarr) ? false : $retarr;	
+		
+	}
+
+}
+
+class ADODB_pdo_base extends ADODB_pdo {
+
+	function ServerInfo()
+	{
+		return ADOConnection::ServerInfo();
+	}
+	
+	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
+	{
+		$ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
+		return $ret;
+	}
+	
+	function MetaTables()
+	{
+		return false;
+	}
+	
+	function MetaColumns()
+	{
+		return false;
+	}
+}
+
+
 class ADODB_pdo extends ADOConnection {
 	var $databaseType = "pdo";	
 	var $dataProvider = "pdo";
@@ -30,16 +306,36 @@
 	var $_haserrorfunctions = true;
 	var $_lastAffectedRows = 0;
 	
+	var $dsnType = '';
 	var $stmt = false;
 	
-	function ADODB_pdo() 
+	function ADODB_pdo()
 	{
 	}
 	
-
+	function _UpdatePDO()
+	{
+		$d = &$this->_driver;
+		$this->fmtDate = $d->fmtDate;
+		$this->fmtTimeStamp = $d->fmtTimeStamp;
+		$this->replaceQuote = $d->replaceQuote;
+		$this->sysDate = $d->sysDate;
+		$this->sysTimeStamp = $d->sysTimeStamp;
+		$this->random = $d->random;
+		$this->concat_operator = $d->concat_operator;
+	}
+	
+	function Time()
+	{
+		return false;
+	}
+	
 	// returns true or false
 	function _connect($argDSN, $argUsername, $argPassword, $argDatabasename, $persist=false)
 	{
+		$at = strpos($argDSN,':');
+		$this->dsnType = substr($argDSN,0,$at);
+
 		$this->_connectionID = new PDO($argDSN, $argUsername, $argPassword);
 		if ($this->_connectionID) {
 			switch(ADODB_ASSOC_CASE){
@@ -52,10 +348,18 @@
 			//$this->_connectionID->setAttribute(PDO_ATTR_ERRMODE,PDO_ERRMODE_SILENT );
 			$this->_connectionID->setAttribute(PDO_ATTR_CASE,$m);
 			
+			$class = 'ADODB_pdo_'.$this->dsnType;
 			//$this->_connectionID->setAttribute(PDO_ATTR_AUTOCOMMIT,true);
+			if (class_exists($class))
+				$this->_driver = new $class();
+			else
+				$this->_driver = new ADODB_pdo_base();
 			
+			$this->_driver->_connectionID = $this->_connectionID;
+			$this->_UpdatePDO();
 			return true;
 		}
+		$this->_driver = new ADODB_pdo_base();
 		return false;
 	}
 	
@@ -65,13 +369,41 @@
 		return $this->_connect($argDSN, $argUsername, $argPassword, $argDatabasename, true);
 	}
 	
+	/*------------------------------------------------------------------------------*/
+	
+	
+	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0) 
+	{	
+		$save = $this->_driver->fetchMode;
+		$this->_driver->fetchMode = $this->fetchMode;
+		$ret = $this->_driver->SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
+		$this->_driver->fetchMode = $save;
+		return $ret;
+	}
+	
+	
+	function ServerInfo()
+	{
+		return $this->_driver->ServerInfo();
+	}
+	
+	function MetaTables($ttype=false,$showSchema=false,$mask=false)
+	{
+		return $this->_driver->MetaTables($ttype,$showSchema,$mask);
+	}
+	
+	function MetaColumns($table,$normalize=true)
+	{
+		return $this->_driver->MetaColumns($table,$normalize);
+	}
+	
 	function ErrorMsg()
 	{
 		if ($this->_stmt) $arr = $this->_stmt->errorInfo();
 		else $arr = $this->_connectionID->errorInfo();
 		
 		if ($arr) {
-			if ($arr[0]) return $arr[2];
+			if ((integer)$arr[0]) return $arr[2];
 			else return '';
 		} else return '-1';
 	}
@@ -85,9 +417,14 @@
 	
 	function ErrorNo()
 	{
-		
-		if ($this->_stmt) return $this->_stmt->errorCode();
-		else return $this->_connectionID->errorInfo();
+		if ($this->_stmt) $err = $this->_stmt->errorCode();
+		else {
+			$arr = $this->_connectionID->errorInfo();
+			if (isset($arr[0])) $err = $arr[0];
+			else $err = -1;
+		}
+		if ($err == '00000') return 0; // allows empty check
+		return $err;
 	}
 
 	function BeginTrans()
@@ -102,6 +439,7 @@
 	
 	function CommitTrans($ok=true) 
 	{ 
+		if (!$this->hasTransactions) return false;
 		if ($this->transOff) return true; 
 		if (!$ok) return $this->RollbackTrans();
 		if ($this->transCnt) $this->transCnt -= 1;
@@ -114,6 +452,7 @@
 	
 	function RollbackTrans()
 	{
+		if (!$this->hasTransactions) return false;
 		if ($this->transOff) return true; 
 		if ($this->transCnt) $this->transCnt -= 1;
 		$this->_autocommit = true;
@@ -145,14 +484,17 @@
 		if (is_array($sql)) {
 			$stmt = $sql[1];
 		} else {
-			$stmt = $this->_connectionID->prepare($sql);		
+			$stmt = $this->_connectionID->prepare($sql);
 		}
 		if ($stmt) {
-			if ($inputarr) $stmt->execute($inputarr);
-			else $stmt->execute();
+			if ($inputarr) $ok = $stmt->execute($inputarr);
+			else $ok = $stmt->execute();
 		}
-		$this->_stmt = $stmt;
-		return $stmt;
+		if ($ok) {
+			$this->_stmt = $stmt;
+			return $stmt;
+		} 
+		return false;
 	}
 
 	// returns true or false
@@ -211,12 +553,17 @@
 		if ($this->_stmt) $arr = $this->_stmt->errorInfo();
 		else $arr = $this->_connectionID->errorInfo();
 		print_r($arr);
-		if ($arr) {
-			if ($arr[0]) return $arr[2];
+		if (is_array($arr)) {
+			if ((integer) $arr[0] && isset($arr[2])) return $arr[2];
 			else return '';
 		} else return '-1';
 	}
 	
+	function NumCols()
+	{
+		return ($this->_stmt) ? $this->_stmt->columnCount() : 0;
+	}
+	
 	function ErrorNo()
 	{
 		if ($this->_stmt) return $this->_stmt->errorCode();
@@ -240,11 +587,13 @@
 			global $ADODB_FETCH_MODE;
 			$mode = $ADODB_FETCH_MODE;
 		}
+		$this->adodbFetchMode = $mode;
 		switch($mode) {
-		default:
-		case ADODB_FETCH_BOTH: $mode = PDO_FETCH_BOTH; break;
 		case ADODB_FETCH_NUM: $mode = PDO_FETCH_NUM; break;
 		case ADODB_FETCH_ASSOC:  $mode = PDO_FETCH_ASSOC; break;
+		
+		case ADODB_FETCH_BOTH: 
+		default: $mode = PDO_FETCH_BOTH; break;
 		}
 		$this->fetchMode = $mode;
 		
@@ -252,21 +601,6 @@
 		$this->ADORecordSet($id);
 	}
 
-
-	// returns the field object
-	function &FetchField($fieldOffset = -1) 
-	{
-		
-		$off=$fieldOffset+1; // offsets begin at 1
-		
-		$o= new ADOFieldObject();
-		$o->name = @odbc_field_name($this->_queryID,$off);
-		$o->type = @odbc_field_type($this->_queryID,$off);
-		$o->max_length = @odbc_field_len($this->_queryID,$off);
-		if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
-		else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
-		return $o;
-	}
 	
 	function Init()
 	{
@@ -282,21 +616,40 @@
 			if ($this->EOF = ($this->_fetch() === false)) {
 				$this->_numOfRows = 0; // _numOfRows could be -1
 			}
-			$this->_numOfFields = sizeof($this->fields);
 		} else {
 			$this->EOF = true;
 		}
 	}
 	
-		
 	function _initrs()
 	{
 	global $ADODB_COUNTRECS;
 	
 		$this->_numOfRows = ($ADODB_COUNTRECS) ? @$this->_queryID->rowCount() : -1;
 		if (!$this->_numOfRows) $this->_numOfRows = -1;
-		$this->_numOfFields =0;
-	}	
+		$this->_numOfFields = $this->_queryID->columnCount();
+	}
+
+	// returns the field object
+	function &FetchField($fieldOffset = -1) 
+	{
+		$off=$fieldOffset+1; // offsets begin at 1
+		
+		$o= new ADOFieldObject();
+		$arr = $this->_queryID->getColumnMeta($fieldOffset);
+		if (!$arr) return false;
+
+		//adodb_pr($arr);
+		$o->name = $arr['name'];
+		if (isset($arr['native_type'])) $o->type = $arr['native_type'];
+		else $o->type = adodb_pdo_type($arr['pdo_type']);
+		$o->max_length = $arr['len'];
+		$o->precision = $arr['precision'];
+		
+		if (ADODB_ASSOC_CASE == 0) $o->name = strtolower($o->name);
+		else if (ADODB_ASSOC_CASE == 1) $o->name = strtoupper($o->name);
+		return $o;
+	}
 	
 	function _seek($row)
 	{
@@ -305,6 +658,8 @@
 	
 	function _fetch()
 	{
+		if (!$this->_queryID) return false;
+		
 		$this->fields = $this->_queryID->fetch($this->fetchMode);
 		return !empty($this->fields);
 	}
@@ -313,6 +668,20 @@
 	{
 		$this->_queryID = false;
 	}
+	
+	function Fields($colname)
+	{
+		if ($this->adodbFetchMode != ADODB_FETCH_NUM) return @$this->fields[$colname];
+		
+		if (!$this->bind) {
+			$this->bind = array();
+			for ($i=0; $i < $this->_numOfFields; $i++) {
+				$o = $this->FetchField($i);
+				$this->bind[strtoupper($o->name)] = $i;
+			}
+		}
+		 return $this->fields[$this->bind[strtoupper($colname)]];
+	}
 
 }
 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres64.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres64.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres64.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -73,12 +73,13 @@
 	var $blobEncodeType = 'C';
 	var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum 
 		FROM pg_class c, pg_attribute a,pg_type t 
-		WHERE relkind = 'r' AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
+		WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s')) and a.attname not like '....%%'
 AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
 
+	// used when schema defined
 	var $metaColumnsSQL1 = "SELECT a.attname, t.typname, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum 
 FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n 
-WHERE relkind = 'r' AND (c.relname='%s' or c.relname = lower('%s'))
+WHERE relkind in ('r','v') AND (c.relname='%s' or c.relname = lower('%s'))
  and c.relnamespace=n.oid and n.nspname='%s' 
 	and a.attname not like '....%%' AND a.attnum > 0 
 	AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
@@ -101,10 +102,11 @@
 	var $_dropSeqSQL = "DROP SEQUENCE %s";
 	var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
 	var $random = 'random()';		/// random function
-	var $autoRollback = true; // apparently pgsql does not autorollback properly before 4.3.4
+	var $autoRollback = true; // apparently pgsql does not autorollback properly before php 4.3.4
 							// http://bugs.php.net/bug.php?id=25404
 							
 	var $_bindInputArray = false; // requires postgresql 7.3+ and ability to modify database
+	var $disableBlobs = false; // set to true to disable blob checking, resulting in 2-5% improvement in performance.
 	
 	// The last (fmtTimeStamp is not entirely correct: 
 	// PostgreSQL also has support for time zones, 
@@ -303,6 +305,14 @@
 				$s .= 'AM';
 				break;
 				
+			case 'w':
+				$s .= 'D';
+				break;
+			
+			case 'l':
+				$s .= 'DAY';
+				break;
+				
 			default:
 			// handle escape characters...
 				if ($ch == '\\') {
@@ -404,8 +414,13 @@
 		// note that there is a pg_escape_bytea function only for php 4.2.0 or later
 	}
 	
+	// assumes bytea for blob, and varchar for clob
 	function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB')
 	{
+	
+		if ($blobtype == 'CLOB') {
+    		return $this->Execute("UPDATE $table SET $column=" . $this->qstr($val) . " WHERE $where");
+		}
 		// do not use bind params which uses qstr(), as blobencode() already quotes data
 		return $this->Execute("UPDATE $table SET $column='".$this->BlobEncode($val)."'::bytea WHERE $where");
 	}
@@ -525,7 +540,7 @@
 			$rs->MoveNext();
 		}
 		$rs->Close();
-		return $retarr;	
+		return empty($retarr) ? false : $retarr;	
 		
 	}
 
@@ -814,9 +829,10 @@
 		{
 		case ADODB_FETCH_NUM: $this->fetchMode = PGSQL_NUM; break;
 		case ADODB_FETCH_ASSOC:$this->fetchMode = PGSQL_ASSOC; break;
-		default:
+		
 		case ADODB_FETCH_DEFAULT:
-		case ADODB_FETCH_BOTH:$this->fetchMode = PGSQL_BOTH; break;
+		case ADODB_FETCH_BOTH:
+		default: $this->fetchMode = PGSQL_BOTH; break;
 		}
 		$this->adodbFetchMode = $mode;
 		$this->ADORecordSet($queryID);
@@ -837,6 +853,8 @@
 		$this->_numOfFields = @pg_numfields($qid);
 		
 		// cache types for blob decode check
+		// apparently pg_fieldtype actually performs an sql query on the database to get the type.
+		if (empty($this->connection->noBlobs))
 		for ($i=0, $max = $this->_numOfFields; $i < $max; $i++) {  
 			if (pg_fieldtype($qid,$i) == 'bytea') {
 				$this->_blobArr[$i] = pg_fieldname($qid,$i);
@@ -921,7 +939,7 @@
 
 		$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);
 		
-	if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
+		if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
 			
 		return (is_array($this->fields));
 	}
@@ -947,6 +965,7 @@
 				case 'NAME':
 		   		case 'BPCHAR':
 				case '_VARCHAR':
+				case 'INET':
 					if ($len <= $this->blobSize) return 'C';
 				
 				case 'TEXT':
@@ -991,4 +1010,4 @@
 	}
 
 }
-?>
+?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres7.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres7.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres7.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
- V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ V4.62 2 Apr 2005  (c) 2000-2005 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.
@@ -90,41 +90,6 @@
 }
 
 
-
-    function xMetaForeignKeys($table, $owner=false, $upper=false)
-	{
-
-        $sql = '
-SELECT t.tgargs as args
-   FROM pg_trigger t,
-        pg_class c,
-        pg_class c2,
-        pg_proc f
-   WHERE t.tgenabled
-   AND t.tgrelid=c.oid
-   AND t.tgconstrrelid=c2.oid
-   AND t.tgfoid=f.oid
-   AND f.proname ~ \'^RI_FKey_check_ins\'
-   AND t.tgargs like \'$1\\\000'.strtolower($table).'%\'
-   ORDER BY t.tgrelid';
-
-        $rs = $this->Execute($sql);
-		if ($rs && !$rs->EOF) {
-			$arr =& $rs->GetArray();
-			$a = array();
-			foreach($arr as $v) {
-                $data = explode(chr(0), $v['args']);
-                if ($upper) {
-                    $a[] = array(strtoupper($data[2]) => strtoupper($data[4].'='.$data[5]));
-                } else {
-                    $a[] = array($data[2] => $data[4].'='.$data[5]);
-                }
-                
-			}
-			return $a;
-		}
-		else return false;
-    }
 	
  	 // this is a set of functions for managing client encoding - very important if the encodings
 	// of your database and your output target (i.e. HTML) don't match

Added: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres8.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres8.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-postgres8.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,12 @@
+<?php
+/*
+ V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
+  Set tabs to 4.
+  
+  NOTE: The "postgres8" driver is remapped to "postgres7". 
+*/
+
+?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-proxy.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-proxy.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-proxy.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sapdb.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sapdb.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sapdb.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlanywhere.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlanywhere.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlanywhere.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-version V4.54 5 Nov 2004 (c) 2000-2004  John Lim (jlim at natsoft.com.my).  All rights
+version V4.62 2 Apr 2005 (c) 2000-2005  John Lim (jlim at 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, 

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
@@ -234,7 +234,52 @@
 		return @sqlite_close($this->_connectionID);
 	}
 
+	function &MetaIndexes ($table, $primary = FALSE, $owner=false)
+	{
+		$false = false;
+		// save old fetch mode
+        global $ADODB_FETCH_MODE;
+        $save = $ADODB_FETCH_MODE;
+        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+        if ($this->fetchMode !== FALSE) {
+               $savem = $this->SetFetchMode(FALSE);
+        }
+		$SQL=sprintf("SELECT name,sql FROM sqlite_master WHERE type='index' AND tbl_name='%s'", strtolower($table));
+        $rs = $this->Execute($SQL);
+        if (!is_object($rs)) {
+			if (isset($savem)) 
+				$this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+            return $false;
+        }
 
+		$indexes = array ();
+		while ($row = $rs->FetchRow()) {
+			if ($primary && preg_match("/primary/i",$row[1]) == 0) continue;
+            if (!isset($indexes[$row[0]])) {
+
+			$indexes[$row[0]] = array(
+				   'unique' => preg_match("/unique/i",$row[1]),
+				   'columns' => array());
+			}
+			/**
+			  * There must be a more elegant way of doing this,
+			  * the index elements appear in the SQL statement
+			  * in cols[1] between parentheses
+			  * e.g CREATE UNIQUE INDEX ware_0 ON warehouse (org,warehouse)
+			  */
+			$cols = explode("(",$row[1]);
+			$cols = explode(")",$cols[1]);
+			array_pop($cols);
+			$indexes[$row[0]]['columns'] = $cols;
+		}
+		if (isset($savem)) { 
+            $this->SetFetchMode($savem);
+			$ADODB_FETCH_MODE = $save;
+		}
+        return $indexes;
+	}
+
 }
 
 /*--------------------------------------------------------------------------------------

Added: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php.bak
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php.bak	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlite.inc.php.bak	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,326 @@
+<?php
+/*
+V4.53 14 Sept 2004  (c) 2000-2004 John Lim (jlim at 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.
+
+  Latest version is available at http://adodb.sourceforge.net
+  
+  SQLite info: http://www.hwaci.com/sw/sqlite/
+    
+  Install Instructions:
+  ====================
+  1. Place this in adodb/drivers
+  2. Rename the file, remove the .txt prefix.
+*/
+
+// security - hide paths
+if (!defined('ADODB_DIR')) die();
+
+class ADODB_sqlite extends ADOConnection {
+	var $databaseType = "sqlite";
+	var $replaceQuote = "''"; // string to use to replace quotes
+	var $concat_operator='||';
+	var $_errorNo = 0;
+	var $hasLimit = true;	
+	var $hasInsertID = true; 		/// supports autoincrement ID?
+	var $hasAffectedRows = true; 	/// supports affected rows for update/delete?
+	var $metaTablesSQL = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name";
+	var $sysDate = "adodb_date('Y-m-d')";
+	var $sysTimeStamp = "adodb_date('Y-m-d H:i:s')";
+	var $fmtTimeStamp = "'Y-m-d H:i:s'";
+	
+	function ADODB_sqlite() 
+	{
+	}
+	
+/*
+  function __get($name) 
+  {
+  	switch($name) {
+	case 'sysDate': return "'".date($this->fmtDate)."'";
+	case 'sysTimeStamp' : return "'".date($this->sysTimeStamp)."'";
+	}
+  }*/
+	
+	function ServerInfo()
+	{
+		$arr['version'] = sqlite_libversion();
+		$arr['description'] = 'SQLite ';
+		$arr['encoding'] = sqlite_libencoding();
+		return $arr;
+	}
+	
+	function BeginTrans()
+	{	  
+		 if ($this->transOff) return true; 
+		 $ret = $this->Execute("BEGIN TRANSACTION");
+		 $this->transCnt += 1;
+		 return true;
+	}
+	
+	function CommitTrans($ok=true) 
+	{ 
+		if ($this->transOff) return true; 
+		if (!$ok) return $this->RollbackTrans();
+		$ret = $this->Execute("COMMIT");
+		if ($this->transCnt>0)$this->transCnt -= 1;
+		return !empty($ret);
+	}
+	
+	function RollbackTrans()
+	{
+		if ($this->transOff) return true; 
+		$ret = $this->Execute("ROLLBACK");
+		if ($this->transCnt>0)$this->transCnt -= 1;
+		return !empty($ret);
+	}
+
+	function _insertid()
+	{
+		return sqlite_last_insert_rowid($this->_connectionID);
+	}
+	
+	function _affectedrows()
+	{
+        return sqlite_changes($this->_connectionID);
+    }
+	
+	function ErrorMsg() 
+ 	{
+		if ($this->_logsql) return $this->_errorMsg;
+		return ($this->_errorNo) ? sqlite_error_string($this->_errorNo) : '';
+	}
+ 
+	function ErrorNo() 
+	{
+		return $this->_errorNo;
+	}
+	
+	function SQLDate($fmt, $col=false)
+	{
+		$fmt = $this->qstr($fmt);
+		return ($col) ? "adodb_date2($fmt,$col)" : "adodb_date($fmt)";
+	}
+	
+	function &MetaColumns($tab)
+	{
+	global $ADODB_FETCH_MODE;
+	
+		$rs = $this->Execute("select * from $tab limit 1");
+		if (!$rs) return false;
+		$arr = array();
+		for ($i=0,$max=$rs->_numOfFields; $i < $max; $i++) {
+			$fld =& $rs->FetchField($i);
+			if ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] =& $fld;	
+			else $arr[strtoupper($fld->name)] =& $fld;
+		}
+		$rs->Close();
+		return $arr;
+	}
+	
+	function _createFunctions()
+	{
+		@sqlite_create_function($this->_connectionID, 'adodb_date', 'adodb_date', 1);
+		@sqlite_create_function($this->_connectionID, 'adodb_date2', 'adodb_date2', 2);
+	}
+	
+
+	// returns true or false
+	function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
+	{
+		if (!function_exists('sqlite_open')) return null;
+		
+		$this->_connectionID = sqlite_open($argHostname);
+		if ($this->_connectionID === false) return false;
+		$this->_createFunctions();
+		return true;
+	}
+	
+	// returns true or false
+	function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
+	{
+		if (!function_exists('sqlite_open')) return null;
+		
+		$this->_connectionID = sqlite_popen($argHostname);
+		if ($this->_connectionID === false) return false;
+		$this->_createFunctions();
+		return true;
+	}
+
+	// returns query ID if successful, otherwise false
+	function _query($sql,$inputarr=false)
+	{
+		$rez = sqlite_query($sql,$this->_connectionID);
+		if (!$rez) {
+			$this->_errorNo = sqlite_last_error($this->_connectionID);
+		}
+		
+		return $rez;
+	}
+	
+	function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0) 
+	{
+		$offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
+		$limitStr  = ($nrows >= 0)  ? " LIMIT $nrows" : ($offset >= 0 ? ' LIMIT 999999999' : '');
+	  	if ($secs2cache)
+	   		$rs =& $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr);
+	  	else
+	   		$rs =& $this->Execute($sql."$limitStr$offsetStr",$inputarr);
+			
+		return $rs;
+	}
+	
+	/*
+		This algorithm is not very efficient, but works even if table locking
+		is not available.
+		
+		Will return false if unable to generate an ID after $MAXLOOPS attempts.
+	*/
+	var $_genSeqSQL = "create table %s (id integer)";
+	
+	function GenID($seq='adodbseq',$start=1)
+	{	
+		// if you have to modify the parameter below, your database is overloaded,
+		// or you need to implement generation of id's yourself!
+		$MAXLOOPS = 100;
+		//$this->debug=1;
+		while (--$MAXLOOPS>=0) {
+<<<<<<< adodb-sqlite.inc.php
+			$num = @$this->GetOne("select id from $seq");
+=======
+			@($num = $this->GetOne("select id from $seq"));
+>>>>>>> 1.42
+			if ($num === false) {
+				$this->Execute(sprintf($this->_genSeqSQL ,$seq));	
+				$start -= 1;
+				$num = '0';
+				$ok = $this->Execute("insert into $seq values($start)");
+				if (!$ok) return false;
+			} 
+			$this->Execute("update $seq set id=id+1 where id=$num");
+			
+			if ($this->affected_rows() > 0) {
+				$num += 1;
+				$this->genID = $num;
+				return $num;
+			}
+		}
+		if ($fn = $this->raiseErrorFn) {
+			$fn($this->databaseType,'GENID',-32000,"Unable to generate unique id after $MAXLOOPS attempts",$seq,$num);
+		}
+		return false;
+	}
+
+	function CreateSequence($seqname='adodbseq',$start=1)
+	{
+		if (empty($this->_genSeqSQL)) return false;
+		$ok = $this->Execute(sprintf($this->_genSeqSQL,$seqname));
+		if (!$ok) return false;
+		$start -= 1;
+		return $this->Execute("insert into $seqname values($start)");
+	}
+	
+	var $_dropSeqSQL = 'drop table %s';
+	function DropSequence($seqname)
+	{
+		if (empty($this->_dropSeqSQL)) return false;
+		return $this->Execute(sprintf($this->_dropSeqSQL,$seqname));
+	}
+	
+	// returns true or false
+	function _close()
+	{
+		return @sqlite_close($this->_connectionID);
+	}
+
+
+}
+
+/*--------------------------------------------------------------------------------------
+		 Class Name: Recordset
+--------------------------------------------------------------------------------------*/
+
+class ADORecordset_sqlite extends ADORecordSet {
+
+	var $databaseType = "sqlite";
+	var $bind = false;
+
+	function ADORecordset_sqlite($queryID,$mode=false)
+	{
+		
+		if ($mode === false) { 
+			global $ADODB_FETCH_MODE;
+			$mode = $ADODB_FETCH_MODE;
+		}
+		switch($mode) {
+		case ADODB_FETCH_NUM: $this->fetchMode = SQLITE_NUM; break;
+		case ADODB_FETCH_ASSOC: $this->fetchMode = SQLITE_ASSOC; break;
+		default: $this->fetchMode = SQLITE_BOTH; break;
+		}
+		
+		$this->_queryID = $queryID;
+	
+		$this->_inited = true;
+		$this->fields = array();
+		if ($queryID) {
+			$this->_currentRow = 0;
+			$this->EOF = !$this->_fetch();
+			@$this->_initrs();
+		} else {
+			$this->_numOfRows = 0;
+			$this->_numOfFields = 0;
+			$this->EOF = true;
+		}
+		
+		return $this->_queryID;
+	}
+
+
+	function &FetchField($fieldOffset = -1)
+	{
+		$fld = new ADOFieldObject;
+		$fld->name = sqlite_field_name($this->_queryID, $fieldOffset);
+		$fld->type = 'VARCHAR';
+		$fld->max_length = -1;
+		return $fld;
+	}
+	
+   function _initrs()
+   {
+		$this->_numOfRows = @sqlite_num_rows($this->_queryID);
+		$this->_numOfFields = @sqlite_num_fields($this->_queryID);
+   }
+
+	function Fields($colname)
+	{
+		if ($this->fetchMode != SQLITE_NUM) return $this->fields[$colname];
+		if (!$this->bind) {
+			$this->bind = array();
+			for ($i=0; $i < $this->_numOfFields; $i++) {
+				$o = $this->FetchField($i);
+				$this->bind[strtoupper($o->name)] = $i;
+			}
+		}
+		
+		 return $this->fields[$this->bind[strtoupper($colname)]];
+	}
+	
+   function _seek($row)
+   {
+   		return sqlite_seek($this->_queryID, $row);
+   }
+
+	function _fetch($ignore_fields=false) 
+	{
+		$this->fields = @sqlite_fetch_array($this->_queryID,$this->fetchMode);
+		return !empty($this->fields);
+	}
+	
+	function _close() 
+	{
+	}
+
+}
+?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlitepo.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlitepo.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sqlitepo.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /*
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim. All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 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. 
@@ -288,7 +288,7 @@
 		}
 		if (!$mode) $this->fetchMode = ADODB_FETCH_ASSOC;
 		else $this->fetchMode = $mode;
-		return $this->ADORecordSet($id,$mode);
+		$this->ADORecordSet($id,$mode);
 	}
 	
 	/*	Returns: an object containing field information. 

Added: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase_ase.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase_ase.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-sybase_ase.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,114 @@
+<?php
+/*
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
+  
+  Set tabs to 4.
+  
+  Contributed by Interakt Online. Thx Cristian MARIN cristic#interaktonline.com
+*/
+class ADODB_sybase_ase extends ADODB_sybase {
+ 	var $databaseType = "sybase_ase";
+	
+	 var $metaTablesSQL="SELECT sysobjects.name FROM sysobjects, sysusers WHERE sysobjects.type='U' AND sysobjects.uid = sysusers.uid";
+	 var $metaColumnsSQL = "SELECT syscolumns.name AS field_name, systypes.name AS type, systypes.length AS width FROM sysobjects, syscolumns, systypes WHERE sysobjects.name='%s' AND syscolumns.id = sysobjects.id AND systypes.type=syscolumns.type";
+	 var $metaDatabasesSQL ="SELECT a.name FROM master.dbo.sysdatabases a, master.dbo.syslogins b WHERE a.suid = b.suid and a.name like '%' and a.name != 'tempdb' and a.status3 != 256  order by 1";
+
+	function ADODB_sybase_ase()
+	{
+	}
+	
+	// split the Views, Tables and procedures.
+	function &MetaTables($ttype=false,$showSchema=false,$mask=false)
+	{
+		if ($this->metaTablesSQL) {
+			// complicated state saving by the need for backward compat
+			
+			if ($ttype == 'VIEWS'){
+						$sql = str_replace('U', 'V', $this->metaTablesSQL);
+			}elseif (false === $ttype){
+						$sql = str_replace('U',"U' OR type='V", $this->metaTablesSQL);
+			}else{ // TABLES OR ANY OTHER 
+						$sql = $this->metaTablesSQL;
+			}
+			$rs = $this->Execute($sql);
+			
+			if ($rs === false || !method_exists($rs, 'GetArray')){
+					return false;
+			}
+			$arr =& $rs->GetArray();
+
+			$arr2 = array();
+			foreach($arr as $key=>$value){
+					$arr2[] = trim($value['name']);
+			}
+			return $arr2;
+		}
+		return false;
+	}
+
+	function MetaDatabases()
+	{
+			$arr = array();
+			if ($this->metaDatabasesSQL!='') {
+				$rs = $this->Execute($this->metaDatabasesSQL);
+				if ($rs && !$rs->EOF){
+					while (!$rs->EOF){
+						$arr[] = $rs->Fields('name');
+						$rs->MoveNext();
+					}
+					return $arr;
+				}
+			}
+			return false;
+	}
+
+	// fix a bug which prevent the metaColumns query to be executed for Sybase ASE
+	function &MetaColumns($table,$upper=false) 
+	{
+		$false = false;
+		if (!empty($this->metaColumnsSQL)) {
+		
+			$rs = $this->Execute(sprintf($this->metaColumnsSQL,$table));
+			if ($rs === false) return $false;
+
+			$retarr = array();
+			while (!$rs->EOF) {
+				$fld =& new ADOFieldObject();
+				$fld->name = $rs->Fields('field_name');
+				$fld->type = $rs->Fields('type');
+				$fld->max_length = $rs->Fields('width');
+				$retarr[strtoupper($fld->name)] = $fld;
+				$rs->MoveNext();
+			}
+			$rs->Close();
+			return $retarr;	
+		}
+		return $false;
+	}
+	
+	function getProcedureList($schema)
+	{
+			return false;
+	}
+
+	function ErrorMsg()
+	{
+		if (!function_exists('sybase_connect')){
+				return 'Your PHP doesn\'t contain the Sybase connection module!';
+		}
+		return parent::ErrorMsg();	
+	}
+}
+
+class adorecordset_sybase_ase extends ADORecordset_sybase {
+var $databaseType = "sybase_ase";
+function ADORecordset_sybase_ase($id,$mode=false)
+	{
+		$this->ADORecordSet_sybase($id,$mode);
+	}
+	
+}
+?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-vfp.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-vfp.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/drivers/adodb-vfp.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Added: plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-da.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-da.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-da.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,33 @@
+<?php
+// Arne Eckmann bananstat#users.sourceforge.net
+$ADODB_LANG_ARRAY = array (
+  	    'LANG'                      => 'da',
+            DB_ERROR                    => 'ukendt fejl',
+            DB_ERROR_ALREADY_EXISTS     => 'eksisterer allerede',
+            DB_ERROR_CANNOT_CREATE      => 'kan ikke oprette',
+            DB_ERROR_CANNOT_DELETE      => 'kan ikke slette',
+            DB_ERROR_CANNOT_DROP        => 'kan ikke droppe',
+            DB_ERROR_CONSTRAINT         => 'begr&aelig;nsning kr&aelig;nket',
+            DB_ERROR_DIVZERO            => 'division med nul',
+            DB_ERROR_INVALID            => 'ugyldig',
+            DB_ERROR_INVALID_DATE       => 'ugyldig dato eller klokkeslet',
+            DB_ERROR_INVALID_NUMBER     => 'ugyldigt tal',
+            DB_ERROR_MISMATCH           => 'mismatch',
+            DB_ERROR_NODBSELECTED       => 'ingen database valgt',
+            DB_ERROR_NOSUCHFIELD        => 'felt findes ikke',
+            DB_ERROR_NOSUCHTABLE        => 'tabel findes ikke',
+            DB_ERROR_NOT_CAPABLE        => 'DB backend opgav',
+            DB_ERROR_NOT_FOUND          => 'ikke fundet',
+            DB_ERROR_NOT_LOCKED         => 'ikke l&aring;st',
+            DB_ERROR_SYNTAX             => 'syntaksfejl',
+            DB_ERROR_UNSUPPORTED        => 'ikke underst&oslash;ttet',
+            DB_ERROR_VALUE_COUNT_ON_ROW => 'resulterende antal felter svarer ikke til foresp&oslash;rgslens antal felter',
+            DB_ERROR_INVALID_DSN        => 'ugyldig DSN',
+            DB_ERROR_CONNECT_FAILED     => 'tilslutning mislykkedes',
+            0	                        => 'ingen fejl', // DB_OK
+            DB_ERROR_NEED_MORE_DATA     => 'utilstr&aelig;kkelige data angivet',
+            DB_ERROR_EXTENSION_NOT_FOUND=> 'udvidelse ikke fundet',
+            DB_ERROR_NOSUCHDB           => 'database ikke fundet',
+            DB_ERROR_ACCESS_VIOLATION   => 'utilstr&aelig;kkelige rettigheder'
+);
+?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-es.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-es.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-es.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,34 +1,33 @@
-<?php
-// contributed by "Horacio Degiorgi" <horaciod at codigophp.com>
-$ADODB_LANG_ARRAY = array (
-			'LANG'                      => 'es',
-            DB_ERROR                    => 'error desconocido',
-            DB_ERROR_ALREADY_EXISTS     => 'ya existe',
-            DB_ERROR_CANNOT_CREATE      => 'imposible crear',
-            DB_ERROR_CANNOT_DELETE      => 'imposible borrar',
-            DB_ERROR_CANNOT_DROP        => 'imposible hacer drop',
-            DB_ERROR_CONSTRAINT         => 'violacion de constraint',
-            DB_ERROR_DIVZERO            => 'division por cero',
-            DB_ERROR_INVALID            => 'invalido',
-            DB_ERROR_INVALID_DATE       => 'fecha u hora invalida',
-            DB_ERROR_INVALID_NUMBER     => 'numero invalido',
-            DB_ERROR_MISMATCH           => 'error',
-            DB_ERROR_NODBSELECTED       => 'no hay base de datos seleccionada',
-            DB_ERROR_NOSUCHFIELD        => 'campo invalido',
-            DB_ERROR_NOSUCHTABLE        => 'tabla no existe',
-            DB_ERROR_NOT_CAPABLE        => 'capacidad invalida para esta DB',
-            DB_ERROR_NOT_FOUND          => 'no encontrado',
-            DB_ERROR_NOT_LOCKED         => 'no bloqueado',
-            DB_ERROR_SYNTAX             => 'error de sintaxis',
-            DB_ERROR_UNSUPPORTED        => 'no soportado',
-            DB_ERROR_VALUE_COUNT_ON_ROW => 'la cantidad de columnas no corresponden a la cantidad de valores',
-            DB_ERROR_INVALID_DSN
-        => 'DSN invalido',
-            DB_ERROR_CONNECT_FAILED     => 'fallo la conexion',
-            0	                       => 'sin error', // DB_OK
-            DB_ERROR_NEED_MORE_DATA     => 'insuficientes datos',
-            DB_ERROR_EXTENSION_NOT_FOUND=> 'extension no encontrada',
-            DB_ERROR_NOSUCHDB           => 'base de datos no encontrada',
-            DB_ERROR_ACCESS_VIOLATION   => 'permisos insuficientes'
-);
+<?php
+// contributed by "Horacio Degiorgi" <horaciod at codigophp.com>
+$ADODB_LANG_ARRAY = array (
+			'LANG'                      => 'es',
+            DB_ERROR                    => 'error desconocido',
+            DB_ERROR_ALREADY_EXISTS     => 'ya existe',
+            DB_ERROR_CANNOT_CREATE      => 'imposible crear',
+            DB_ERROR_CANNOT_DELETE      => 'imposible borrar',
+            DB_ERROR_CANNOT_DROP        => 'imposible hacer drop',
+            DB_ERROR_CONSTRAINT         => 'violacion de constraint',
+            DB_ERROR_DIVZERO            => 'division por cero',
+            DB_ERROR_INVALID            => 'invalido',
+            DB_ERROR_INVALID_DATE       => 'fecha u hora invalida',
+            DB_ERROR_INVALID_NUMBER     => 'numero invalido',
+            DB_ERROR_MISMATCH           => 'error',
+            DB_ERROR_NODBSELECTED       => 'no hay base de datos seleccionada',
+            DB_ERROR_NOSUCHFIELD        => 'campo invalido',
+            DB_ERROR_NOSUCHTABLE        => 'tabla no existe',
+            DB_ERROR_NOT_CAPABLE        => 'capacidad invalida para esta DB',
+            DB_ERROR_NOT_FOUND          => 'no encontrado',
+            DB_ERROR_NOT_LOCKED         => 'no bloqueado',
+            DB_ERROR_SYNTAX             => 'error de sintaxis',
+            DB_ERROR_UNSUPPORTED        => 'no soportado',
+            DB_ERROR_VALUE_COUNT_ON_ROW => 'la cantidad de columnas no corresponden a la cantidad de valores',
+            DB_ERROR_INVALID_DSN        => 'DSN invalido',
+            DB_ERROR_CONNECT_FAILED     => 'fallo la conexion',
+            0	                       => 'sin error', // DB_OK
+            DB_ERROR_NEED_MORE_DATA     => 'insuficientes datos',
+            DB_ERROR_EXTENSION_NOT_FOUND=> 'extension no encontrada',
+            DB_ERROR_NOSUCHDB           => 'base de datos no encontrada',
+            DB_ERROR_ACCESS_VIOLATION   => 'permisos insuficientes'
+);
 ?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-esperanto.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-esperanto.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-esperanto.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,35 @@
+<?php
+// Vivu Esperanto cxiam! 
+// Traduko fare de Antono Vasiljev (anders[#]brainactive.org)
+
+$ADODB_LANG_ARRAY = array (
+             'LANG'                      => 'eo',
+            DB_ERROR                    => 'nekonata eraro',
+            DB_ERROR_ALREADY_EXISTS     => 'jam ekzistas',
+            DB_ERROR_CANNOT_CREATE      => 'maleblas krei',
+            DB_ERROR_CANNOT_DELETE      => 'maleblas elimini',
+            DB_ERROR_CANNOT_DROP        => 'maleblas elimini (drop)',
+            DB_ERROR_CONSTRAINT         => 'rompo de kondicxoj de provo',
+            DB_ERROR_DIVZERO            => 'divido per 0 (nul)',
+            DB_ERROR_INVALID            => 'malregule',
+            DB_ERROR_INVALID_DATE       => 'malregula dato kaj tempo',
+            DB_ERROR_INVALID_NUMBER     => 'malregula nombro',
+            DB_ERROR_MISMATCH           => 'eraro',
+            DB_ERROR_NODBSELECTED       => 'datumbazo ne elektita',
+            DB_ERROR_NOSUCHFIELD        => 'ne ekzistas kampo',
+            DB_ERROR_NOSUCHTABLE        => 'ne ekzistas tabelo',
+            DB_ERROR_NOT_CAPABLE        => 'DBMS ne povas',
+            DB_ERROR_NOT_FOUND          => 'ne trovita',
+            DB_ERROR_NOT_LOCKED         => 'ne blokita',
+            DB_ERROR_SYNTAX             => 'sintaksa eraro',
+            DB_ERROR_UNSUPPORTED        => 'ne apogata',
+            DB_ERROR_VALUE_COUNT_ON_ROW => 'nombrilo de valoroj en linio',
+            DB_ERROR_INVALID_DSN        => 'malregula DSN-o',
+            DB_ERROR_CONNECT_FAILED     => 'konekto malsukcesa',
+            0                               => 'cxio bone', // DB_OK
+            DB_ERROR_NEED_MORE_DATA     => 'ne suficxe da datumo',
+            DB_ERROR_EXTENSION_NOT_FOUND=> 'etendo ne trovita',
+            DB_ERROR_NOSUCHDB           => 'datumbazo ne ekzistas',
+            DB_ERROR_ACCESS_VIOLATION   => 'ne suficxe da rajto por atingo'
+);
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-uk1251.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-uk1251.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/lang/adodb-uk1251.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,35 @@
+<?php
+
+// Ukrainian language file contributed by  Alex Rootoff rootoff{AT}pisem.net.
+
+$ADODB_LANG_ARRAY = array (
+             'LANG'                      => 'uk1251',
+            DB_ERROR                    => 'íåâ³äîìà ïîìèëêà',
+            DB_ERROR_ALREADY_EXISTS     => 'âæå ³ñíóº',
+            DB_ERROR_CANNOT_CREATE      => 'íåìîæëèâî ñòâîðèòè',
+            DB_ERROR_CANNOT_DELETE      => 'íåìîæëèâî âèäàëèòè',
+            DB_ERROR_CANNOT_DROP        => 'íåìîæëèâî çíèùèòè (drop)',
+            DB_ERROR_CONSTRAINT         => 'ïîðóøåííÿ óìîâ ïåðåâ³ðêè',
+            DB_ERROR_DIVZERO            => 'ä³ëåííÿ íà 0',
+            DB_ERROR_INVALID            => 'íåïðàâèëüíî',
+            DB_ERROR_INVALID_DATE       => 'íåïðàâèëüíà äàòà ÷è ÷àñ',
+            DB_ERROR_INVALID_NUMBER     => 'íåïðàâèëüíå ÷èñëî',
+            DB_ERROR_MISMATCH           => 'ïîìèëêà',
+            DB_ERROR_NODBSELECTED       => 'íå âèáðàíî ÁÄ',
+            DB_ERROR_NOSUCHFIELD        => 'íå ³ñíóº ïîëå',
+            DB_ERROR_NOSUCHTABLE        => 'íå ³ñíóº òàáëèöÿ',
+            DB_ERROR_NOT_CAPABLE        => 'ÑÓÁÄ íå â ñòàí³',
+            DB_ERROR_NOT_FOUND          => 'íå çíàéäåíî',
+            DB_ERROR_NOT_LOCKED         => 'íå çàáëîêîâàíî',
+            DB_ERROR_SYNTAX             => 'ñèíòàêñè÷íà ïîìèëêà',
+            DB_ERROR_UNSUPPORTED        => 'íå ï³äòðèìóºòüñÿ',
+            DB_ERROR_VALUE_COUNT_ON_ROW => 'ðàõ³âíèê çíà÷åíü â ñòð³÷ö³',
+            DB_ERROR_INVALID_DSN        => 'íåïðàâèëüíà DSN',
+            DB_ERROR_CONNECT_FAILED     => 'ç\'ºäíàííÿ íåóñï³øíå',
+            0                               => 'âñå ãàðàçä', // DB_OK
+            DB_ERROR_NEED_MORE_DATA     => 'íàäàíî íåäîñòàòíüî äàíèõ',
+            DB_ERROR_EXTENSION_NOT_FOUND=> 'ðîçøèðåííÿ íå çíàéäåíî',
+            DB_ERROR_NOSUCHDB           => 'íå ³ñíóº ÁÄ',
+            DB_ERROR_ACCESS_VIOLATION   => 'íåäîñòàòíüî ïðàâ äîñòóïà'
+);
+?>

Added: plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container/ADOdb.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container/ADOdb.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/pear/Auth/Container/ADOdb.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,412 @@
+<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4                                                        |
+// +----------------------------------------------------------------------+
+// |                                                                      |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license,      |
+// | that is bundled with this package in the file LICENSE, and is        |
+// | available at through the world-wide-web at                           |
+// | http://www.php.net/license/2_02.txt.                                 |
+// | If you did not receive a copy of the PHP license and are unable to   |
+// | obtain it through the world-wide-web, please send a note to          |
+// | license at php.net so we can mail you a copy immediately.               |
+// +----------------------------------------------------------------------+
+// | Authors: Martin Jansen <mj at php.net>
+// |	Richard Tango-Lowy <richtl at arscognita.com>                                  |
+// +----------------------------------------------------------------------+
+//
+// $Id: ADOdb.php,v 1.2 2004/11/11 07:19:11 jlim Exp $
+//
+
+require_once 'Auth/Container.php';
+require_once 'adodb.inc.php';
+require_once 'adodb-pear.inc.php';
+require_once 'adodb-errorpear.inc.php';
+
+/**
+ * Storage driver for fetching login data from a database using ADOdb-PHP.
+ *
+ * This storage driver can use all databases which are supported
+ * by the ADBdb DB abstraction layer to fetch login data.
+ * See http://php.weblogs.com/adodb for information on ADOdb.
+ * NOTE: The ADOdb directory MUST be in your PHP include_path!
+ *
+ * @author   Richard Tango-Lowy <richtl at arscognita.com>
+ * @package  Auth
+ * @version  $Revision: 1.2 $
+ */
+class Auth_Container_ADOdb extends Auth_Container
+{
+
+    /**
+     * Additional options for the storage container
+     * @var array
+     */
+    var $options = array();
+
+    /**
+     * DB object
+     * @var object
+     */
+    var $db = null;
+    var $dsn = '';
+	
+    /**
+     * User that is currently selected from the DB.
+     * @var string
+     */
+    var $activeUser = '';
+
+    // {{{ Constructor
+
+    /**
+     * Constructor of the container class
+     *
+     * Initate connection to the database via PEAR::ADOdb
+     *
+     * @param  string Connection data or DB object
+     * @return object Returns an error object if something went wrong
+     */
+    function Auth_Container_ADOdb($dsn)
+    {
+        $this->_setDefaults();
+		
+        if (is_array($dsn)) {
+            $this->_parseOptions($dsn);
+
+            if (empty($this->options['dsn'])) {
+                PEAR::raiseError('No connection parameters specified!');
+            }
+        } else {
+        	// Extract db_type from dsn string.
+            $this->options['dsn'] = $dsn;
+        }
+    }
+
+    // }}}
+    // {{{ _connect()
+
+    /**
+     * Connect to database by using the given DSN string
+     *
+     * @access private
+     * @param  string DSN string
+     * @return mixed  Object on error, otherwise bool
+     */
+     function _connect($dsn)
+    {
+        if (is_string($dsn) || is_array($dsn)) {
+        	if(!$this->db) {
+	        	$this->db = &ADONewConnection($dsn);
+	    		if( $err = ADODB_Pear_error() ) {
+	   	    		return PEAR::raiseError($err);
+	    		}
+        	}
+        	
+        } else {
+            return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
+                                    41,
+                                    PEAR_ERROR_RETURN,
+                                    null,
+                                    null
+                                    );
+        }
+        
+        if(!$this->db) {
+        	return PEAR::raiseError(ADODB_Pear_error());
+        } else {
+        	return true;
+        }
+    }
+
+    // }}}
+    // {{{ _prepare()
+
+    /**
+     * Prepare database connection
+     *
+     * This function checks if we have already opened a connection to
+     * the database. If that's not the case, a new connection is opened.
+     *
+     * @access private
+     * @return mixed True or a DB error object.
+     */
+    function _prepare()
+    {
+    	if(!$this->db) {
+    		$res = $this->_connect($this->options['dsn']);  		
+    	}
+        return true;
+    }
+
+    // }}}
+    // {{{ query()
+
+    /**
+     * Prepare query to the database
+     *
+     * This function checks if we have already opened a connection to
+     * the database. If that's not the case, a new connection is opened.
+     * After that the query is passed to the database.
+     *
+     * @access public
+     * @param  string Query string
+     * @return mixed  a DB_result object or DB_OK on success, a DB
+     *                or PEAR error on failure
+     */
+    function query($query)
+    {
+        $err = $this->_prepare();
+        if ($err !== true) {
+            return $err;
+        }
+        return $this->db->query($query);
+    }
+
+    // }}}
+    // {{{ _setDefaults()
+
+    /**
+     * Set some default options
+     *
+     * @access private
+     * @return void
+     */
+    function _setDefaults()
+    {
+    	$this->options['db_type']	= 'mysql';
+        $this->options['table']       = 'auth';
+        $this->options['usernamecol'] = 'username';
+        $this->options['passwordcol'] = 'password';
+        $this->options['dsn']         = '';
+        $this->options['db_fields']   = '';
+        $this->options['cryptType']   = 'md5';
+    }
+
+    // }}}
+    // {{{ _parseOptions()
+
+    /**
+     * Parse options passed to the container class
+     *
+     * @access private
+     * @param  array
+     */
+    function _parseOptions($array)
+    {
+        foreach ($array as $key => $value) {
+            if (isset($this->options[$key])) {
+                $this->options[$key] = $value;
+            }
+        }
+
+        /* Include additional fields if they exist */
+        if(!empty($this->options['db_fields'])){
+            if(is_array($this->options['db_fields'])){
+                $this->options['db_fields'] = join($this->options['db_fields'], ', ');
+            }
+            $this->options['db_fields'] = ', '.$this->options['db_fields'];
+        }
+    }
+
+    // }}}
+    // {{{ fetchData()
+
+    /**
+     * Get user information from database
+     *
+     * This function uses the given username to fetch
+     * the corresponding login data from the database
+     * table. If an account that matches the passed username
+     * and password is found, the function returns true.
+     * Otherwise it returns false.
+     *
+     * @param   string Username
+     * @param   string Password
+     * @return  mixed  Error object or boolean
+     */
+    function fetchData($username, $password)
+    {
+        // Prepare for a database query
+        $err = $this->_prepare();
+        if ($err !== true) {
+            return PEAR::raiseError($err->getMessage(), $err->getCode());
+        }
+
+        // Find if db_fields contains a *, i so assume all col are selected
+        if(strstr($this->options['db_fields'], '*')){
+            $sql_from = "*";
+        }
+        else{
+            $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
+        }
+        
+        $query = "SELECT ".$sql_from.
+                " FROM ".$this->options['table'].
+                " WHERE ".$this->options['usernamecol']." = " . $this->db->Quote($username);
+        
+        $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+        $rset = $this->db->Execute( $query );
+        $res = $rset->fetchRow();
+
+        if (DB::isError($res)) {
+            return PEAR::raiseError($res->getMessage(), $res->getCode());
+        }
+        if (!is_array($res)) {
+            $this->activeUser = '';
+            return false;
+        }
+        if ($this->verifyPassword(trim($password, "\r\n"),
+                                  trim($res[$this->options['passwordcol']], "\r\n"),
+                                  $this->options['cryptType'])) {
+            // Store additional field values in the session
+            foreach ($res as $key => $value) {
+                if ($key == $this->options['passwordcol'] ||
+                    $key == $this->options['usernamecol']) {
+                    continue;
+                }
+                // Use reference to the auth object if exists
+                // This is because the auth session variable can change so a static call to setAuthData does not make sence
+                if(is_object($this->_auth_obj)){
+                    $this->_auth_obj->setAuthData($key, $value);
+                } else {
+                    Auth::setAuthData($key, $value);
+                }
+            }
+
+            return true;
+        }
+
+        $this->activeUser = $res[$this->options['usernamecol']];
+        return false;
+    }
+
+    // }}}
+    // {{{ listUsers()
+
+    function listUsers()
+    {
+        $err = $this->_prepare();
+        if ($err !== true) {
+            return PEAR::raiseError($err->getMessage(), $err->getCode());
+        }
+
+        $retVal = array();
+
+        // Find if db_fileds contains a *, i so assume all col are selected
+        if(strstr($this->options['db_fields'], '*')){
+            $sql_from = "*";
+        }
+        else{
+            $sql_from = $this->options['usernamecol'] . ", ".$this->options['passwordcol'].$this->options['db_fields'];
+        }
+
+        $query = sprintf("SELECT %s FROM %s",
+                         $sql_from,
+                         $this->options['table']
+                         );
+        $res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
+
+        if (DB::isError($res)) {
+            return PEAR::raiseError($res->getMessage(), $res->getCode());
+        } else {
+            foreach ($res as $user) {
+                $user['username'] = $user[$this->options['usernamecol']];
+                $retVal[] = $user;
+            }
+        }
+        return $retVal;
+    }
+
+    // }}}
+    // {{{ addUser()
+
+    /**
+     * Add user to the storage container
+     *
+     * @access public
+     * @param  string Username
+     * @param  string Password
+     * @param  mixed  Additional information that are stored in the DB
+     *
+     * @return mixed True on success, otherwise error object
+     */
+    function addUser($username, $password, $additional = "")
+    {
+        if (function_exists($this->options['cryptType'])) {
+            $cryptFunction = $this->options['cryptType'];
+        } else {
+            $cryptFunction = 'md5';
+        }
+
+        $additional_key   = '';
+        $additional_value = '';
+
+        if (is_array($additional)) {
+            foreach ($additional as $key => $value) {
+                $additional_key .= ', ' . $key;
+                $additional_value .= ", '" . $value . "'";
+            }
+        }
+
+        $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)",
+                         $this->options['table'],
+                         $this->options['usernamecol'],
+                         $this->options['passwordcol'],
+                         $additional_key,
+                         $username,
+                         $cryptFunction($password),
+                         $additional_value
+                         );
+
+        $res = $this->query($query);
+
+        if (DB::isError($res)) {
+           return PEAR::raiseError($res->getMessage(), $res->getCode());
+        } else {
+          return true;
+        }
+    }
+
+    // }}}
+    // {{{ removeUser()
+
+    /**
+     * Remove user from the storage container
+     *
+     * @access public
+     * @param  string Username
+     *
+     * @return mixed True on success, otherwise error object
+     */
+    function removeUser($username)
+    {
+        $query = sprintf("DELETE FROM %s WHERE %s = '%s'",
+                         $this->options['table'],
+                         $this->options['usernamecol'],
+                         $username
+                         );
+
+        $res = $this->query($query);
+
+        if (DB::isError($res)) {
+           return PEAR::raiseError($res->getMessage(), $res->getCode());
+        } else {
+          return true;
+        }
+    }
+
+    // }}}
+}
+
+function showDbg( $string ) {
+	print "<P>$string</P>";
+}
+function dump( $var, $str, $vardump = false ) {
+	print "<H4>$str</H4><pre>";
+	( !$vardump ) ? ( print_r( $var )) : ( var_dump( $var ));
+	print "</pre>";
+}
+?>

Added: plog/branches/plog-1.0.1/class/database/adodb/pear/readme.Auth.txt
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/pear/readme.Auth.txt	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/pear/readme.Auth.txt	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,20 @@
+From: Rich Tango-Lowy (richtl#arscognita.com)
+Date: Sat, May 29, 2004 11:20 am
+
+OK, I hacked out an ADOdb container for PEAR-Auth. The error handling's 
+a bit of a mess, but all the methods work.
+
+Copy ADOdb.php to your pear/Auth/Container/ directory.
+
+Use the ADOdb container exactly as you would the DB
+container, but specify 'ADOdb' instead of 'DB':
+
+$dsn = "mysql://myuser:mypass@localhost/authdb";
+$a = new Auth("ADOdb", $dsn, "loginFunction");
+
+
+-------------------
+
+John Lim adds:
+
+See http://pear.php.net/manual/en/package.authentication.php

Modified: plog/branches/plog-1.0.1/class/database/adodb/perf/perf-db2.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/perf/perf-db2.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/perf/perf-db2.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/perf/perf-informix.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/perf/perf-informix.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/perf/perf-informix.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mssql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mssql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mssql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mysql.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mysql.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/perf/perf-mysql.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
@@ -227,7 +227,6 @@
 	*/
 	function GetInnoDBHitRatio()
 	{
-	global $HTTP_SESSION_VARS;
 	
 		$rs = $this->conn->Execute('show innodb status');
 		if (!$rs || $rs->EOF) return 0;
@@ -237,10 +236,10 @@
 		$stat = substr($stat,$at,200);
 		if (preg_match('!Buffer pool hit rate\s*([0-9]*) / ([0-9]*)!',$stat,$arr)) {
 			$val = 100*$arr[1]/$arr[2];
-			$HTTP_SESSION_VARS['INNODB_HIT_PCT'] = $val;
+			$_SESSION['INNODB_HIT_PCT'] = $val;
 			return $val;
 		} else {
-			if (isset($HTTP_SESSION_VARS['INNODB_HIT_PCT'])) return $HTTP_SESSION_VARS['INNODB_HIT_PCT'];
+			if (isset($_SESSION['INNODB_HIT_PCT'])) return $_SESSION['INNODB_HIT_PCT'];
 			return 0;
 		}
 		return 0;

Modified: plog/branches/plog-1.0.1/class/database/adodb/perf/perf-oci8.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/perf/perf-oci8.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/perf/perf-oci8.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
@@ -345,7 +345,7 @@
 				$check = $rs->fields[0].'::'.$rs->fields[1];			
 			} else
 				$sql .= $rs->fields[2];
-			
+			if (substr($sql,strlen($sql)-1) == "\0") $sql = substr($sql,0,strlen($sql)-1);
 			$rs->MoveNext();
 		}
 		$rs->Close();
@@ -402,13 +402,13 @@
 order by
   1 desc, s.address, p.piece";
 
-  		global $ADODB_CACHE_MODE,$HTTP_GET_VARS;
-  		if (isset($HTTP_GET_VARS['expsixora']) && isset($HTTP_GET_VARS['sql'])) {
-				$partial = empty($HTTP_GET_VARS['part']);
-				echo "<a name=explain></a>".$this->Explain($HTTP_GET_VARS['sql'],$partial)."\n";
+  		global $ADODB_CACHE_MODE;
+  		if (isset($_GET['expsixora']) && isset($_GET['sql'])) {
+				$partial = empty($_GET['part']);
+				echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
 		}
 
-		if (isset($HTTP_GET_VARS['sql'])) return $this->_SuspiciousSQL();
+		if (isset($_GET['sql'])) return $this->_SuspiciousSQL();
 		
 		$save = $ADODB_CACHE_MODE;
 		$ADODB_CACHE_MODE = ADODB_FETCH_NUM;
@@ -467,13 +467,13 @@
 order by
   1 desc, s.address, p.piece
 ";
-		global $ADODB_CACHE_MODE,$HTTP_GET_VARS;
-  		if (isset($HTTP_GET_VARS['expeixora']) && isset($HTTP_GET_VARS['sql'])) {
-			$partial = empty($HTTP_GET_VARS['part']);	
-			echo "<a name=explain></a>".$this->Explain($HTTP_GET_VARS['sql'],$partial)."\n";
+		global $ADODB_CACHE_MODE;
+  		if (isset($_GET['expeixora']) && isset($_GET['sql'])) {
+			$partial = empty($_GET['part']);	
+			echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
 		}
 		
-		if (isset($HTTP_GET_VARS['sql'])) {
+		if (isset($_GET['sql'])) {
 			 $var =& $this->_ExpensiveSQL();
 			 return $var;
 		}

Modified: plog/branches/plog-1.0.1/class/database/adodb/perf/perf-postgres.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/perf/perf-postgres.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/perf/perf-postgres.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /* 
-V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 

Modified: plog/branches/plog-1.0.1/class/database/adodb/pivottable.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/pivottable.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/pivottable.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.50 6 July 2004 (c) 2000-2005 John Lim (jlim at 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. 
@@ -37,6 +37,8 @@
 	if ($aggfield) $hidecnt = true;
 	else $hidecnt = false;
 	
+	$iif = strpos($db->databaseType,'access') !== false; 
+		// note - vfp still doesn' work even with IIF enabled || $db->databaseType == 'vfp';
 	
 	//$hidecnt = false;
 	
@@ -47,20 +49,39 @@
 	$sel = "$rowfields, ";
 	if (is_array($colfield)) {
 		foreach ($colfield as $k => $v) {
-			if (!$hidecnt) $sel .= "\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", ";
-			if ($aggfield)
-				$sel .= "\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", ";
+			$k = trim($k);
+			if (!$hidecnt) {
+				$sel .= $iif ? 
+					"\n\t$aggfn(IIF($v,1,0)) AS \"$k\", "
+					:
+					"\n\t$aggfn(CASE WHEN $v THEN 1 ELSE 0 END) AS \"$k\", ";
+			}
+			if ($aggfield) {
+				$sel .= $iif ?
+					"\n\t$aggfn(IIF($v,$aggfield,0)) AS \"$sumlabel$k\", "
+					:
+					"\n\t$aggfn(CASE WHEN $v THEN $aggfield ELSE 0 END) AS \"$sumlabel$k\", ";
+			}
 		} 
 	} else {
 		foreach ($colarr as $v) {
 			if (!is_numeric($v)) $vq = $db->qstr($v);
 			else $vq = $v;
+			$v = trim($v);
 			if (strlen($v) == 0	) $v = 'null';
-			if (!$hidecnt) $sel .= "\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", ";
+			if (!$hidecnt) {
+				$sel .= $iif ?
+					"\n\t$aggfn(IIF($colfield=$vq,1,0)) AS \"$v\", "
+					:
+					"\n\t$aggfn(CASE WHEN $colfield=$vq THEN 1 ELSE 0 END) AS \"$v\", ";
+			}
 			if ($aggfield) {
 				if ($hidecnt) $label = $v;
 				else $label = "{$v}_$aggfield";
-				$sel .= "\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", ";
+				$sel .= $iif ?
+					"\n\t$aggfn(IIF($colfield=$vq,$aggfield,0)) AS \"$label\", "
+					:
+					"\n\t$aggfn(CASE WHEN $colfield=$vq THEN $aggfield ELSE 0 END) AS \"$label\", ";
 			}
 		}
 	}
@@ -123,7 +144,7 @@
 #
 # Query the main "product" table
 # Set the rows to CompanyName and QuantityPerUnit
-# and the columns to the UnitsInStock for different ranges
+# and the columns to the UnitsInStock for diiferent ranges
 # and define the joins to link to lookup tables 
 # "categories" and "suppliers"
 #

Modified: plog/branches/plog-1.0.1/class/database/adodb/rsfilter.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/rsfilter.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/rsfilter.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php
 /** 
- * @version V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at 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. 
@@ -42,7 +42,14 @@
 	}
 	$rows = $rs->RecordCount();
 	for ($i=0; $i < $rows; $i++) {
-		$fn($rs->_array[$i],$rs);
+		if (is_array ($fn)) {
+        	$obj = $fn[0];
+        	$method = $fn[1];
+        	$obj->$method ($rs->_array[$i],$rs);
+      } else {
+			$fn($rs->_array[$i],$rs);
+      }
+	  
 	}
 	if (!$rs->EOF) {
 		$rs->_currentRow = 0;

Added: plog/branches/plog-1.0.1/class/database/adodb/server.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/server.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/server.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,98 @@
+<?php
+
+/** 
+ * @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at 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. 
+ */
+ 
+/* Documentation on usage is at http://php.weblogs.com/adodb_csv
+ *
+ * Legal query string parameters:
+ * 
+ * sql = holds sql string
+ * nrows = number of rows to return 
+ * offset = skip offset rows of data
+ * fetch = $ADODB_FETCH_MODE
+ * 
+ * example:
+ *
+ * http://localhost/php/server.php?select+*+from+table&nrows=10&offset=2
+ */
+
+
+/* 
+ * Define the IP address you want to accept requests from 
+ * as a security measure. If blank we accept anyone promisciously!
+ */
+$ACCEPTIP = '';
+
+/*
+ * Connection parameters
+ */
+$driver = 'mysql';
+$host = 'localhost'; // DSN for odbc
+$uid = 'root';
+$pwd = '';
+$database = 'test';
+
+/*============================ DO NOT MODIFY BELOW HERE =================================*/
+// $sep must match csv2rs() in adodb.inc.php
+$sep = ' :::: ';
+
+include('./adodb.inc.php');
+include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
+
+function err($s)
+{
+	die('**** '.$s.' ');
+}
+
+// undo stupid magic quotes
+function undomq(&$m) 
+{
+	if (get_magic_quotes_gpc()) {
+		// undo the damage
+		$m = str_replace('\\\\','\\',$m);
+		$m = str_replace('\"','"',$m);
+		$m = str_replace('\\\'','\'',$m);
+		
+	}
+	return $m;
+}
+
+///////////////////////////////////////// DEFINITIONS
+
+
+$remote = $_SERVER["REMOTE_ADDR"]; 
+ 
+if (empty($_GET['sql'])) err('No SQL');
+
+if (!empty($ACCEPTIP))
+ if ($remote != '127.0.0.1' && $remote != $ACCEPTIP) 
+ 	err("Unauthorised client: '$remote'");
+
+
+$conn = &ADONewConnection($driver);
+
+if (!$conn->Connect($host,$uid,$pwd,$database)) err($conn->ErrorNo(). $sep . $conn->ErrorMsg());
+$sql = undomq($_GET['sql']);
+
+if (isset($_GET['fetch']))
+	$ADODB_FETCH_MODE = $_GET['fetch'];
+	
+if (isset($_GET['nrows'])) {
+	$nrows = $_GET['nrows'];
+	$offset = isset($_GET['offset']) ? $_GET['offset'] : -1;
+	$rs = $conn->SelectLimit($sql,$nrows,$offset);
+} else 
+	$rs = $conn->Execute($sql);
+if ($rs){ 
+	//$rs->timeToLive = 1;
+	echo _rs2serialize($rs,$conn,$sql);
+	$rs->Close();
+} else
+	err($conn->ErrorNo(). $sep .$conn->ErrorMsg());
+
+?>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-bzip2.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-bzip2.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-bzip2.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-gzip.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-gzip.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-compress-gzip.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-cryptsession.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-cryptsession.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-cryptsession.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-mcrypt.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-mcrypt.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-mcrypt.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-md5.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-md5.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-md5.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-secret.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-secret.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-encrypt-secret.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session-clob.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session-clob.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session-clob.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,

Modified: plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/session/adodb-session.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -2,7 +2,7 @@
 
 
 /*
-V4.01 23 Oct 2003  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at natsoft.com.my). All rights reserved.
          Contributed by Ross Smith (adodb at netebb.com). 
   Released under both BSD license and Lesser GPL library license.
   Whenever there is any discrepancy between the two licenses,
@@ -33,6 +33,58 @@
 
 define('ADODB_SESSION', dirname(__FILE__));
 
+
+/* 
+	Unserialize session data manually. See http://phplens.com/lens/lensforum/msgs.php?id=9821 
+	
+	From Kerr Schere, to unserialize session data stored via ADOdb. 
+	1. Pull the session data from the db and loop through it. 
+	2. Inside the loop, you will need to urldecode the data column. 
+	3. After urldecode, run the serialized string through this function:
+
+*/
+function adodb_unserialize( $serialized_string ) 
+{
+	$variables = array( );
+	$a = preg_split( "/(\w+)\|/", $serialized_string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
+	for( $i = 0; $i < count( $a ); $i = $i+2 ) {
+		$variables[$a[$i]] = unserialize( $a[$i+1] );
+	}
+	return( $variables );
+}
+
+/*
+	Thanks Joe Li. See http://phplens.com/lens/lensforum/msgs.php?id=11487&x=1
+	Since adodb 4.61.
+*/
+function adodb_session_regenerate_id() 
+{
+	$conn =& ADODB_Session::_conn();
+	if (!$conn) return false;
+
+	$old_id = session_id();
+	if (function_exists('session_regenerate_id')) {
+		session_regenerate_id();
+	} else {
+		session_id(md5(uniqid(rand(), true)));
+		$ck = session_get_cookie_params();
+		setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
+		//@session_start();
+	}
+	$new_id = session_id();
+	$ok =& $conn->Execute('UPDATE '. ADODB_Session::table(). ' SET sesskey='. $conn->qstr($new_id). ' WHERE sesskey='.$conn->qstr($old_id));
+	
+	/* it is possible that the update statement fails due to a collision */
+	if (!$ok) {
+		session_id($old_id);
+		if (empty($ck)) $ck = session_get_cookie_params();
+		setcookie(session_name(), session_id(), false, $ck['path'], $ck['domain'], $ck['secure']);
+		return false;
+	}
+	
+	return true;
+}
+
 /*!
 	\static
 */
@@ -473,12 +525,10 @@
 		Close the connection
 	*/
 	function close() {
+/*
 		$conn =& ADODB_Session::_conn();
-
-		if ($conn) {
-			$conn->Close();
-		}
-
+		if ($conn) $conn->Close();
+*/
 		return true;
 	}
 
@@ -542,16 +592,16 @@
 		$filter			= ADODB_Session::filter();
 		$lifetime		= ADODB_Session::lifetime();
 		$table			= ADODB_Session::table();
-
+	
 		if (!$conn) {
 			return false;
 		}
-
+		$qkey = $conn->qstr($key);
+	
 		assert('$table');
 
 		$expiry = time() + $lifetime;
 
-		$qkey = $conn->quote($key);
 		$binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : '';
 
 		// crc32 optimization since adodb 2.1
@@ -560,8 +610,8 @@
 			if ($debug) {
 				echo '<p>Session: Only updating date - crc32 not changed</p>';
 			}
-			$sql = "UPDATE $table SET expiry = $expiry WHERE $binary sesskey = $qkey AND expiry >= " . time();
-			$rs =& $conn->Execute($sql);
+			$sql = "UPDATE $table SET expiry = ".$conn->Param('0')." WHERE $binary sesskey = ".$conn->Param('1')." AND expiry >= ".$conn->Param('2');
+			$rs =& $conn->Execute($sql,array($expiry,$key,time()));
 			ADODB_Session::_dumprs($rs);
 			if ($rs) {
 				$rs->Close();
@@ -604,7 +654,7 @@
 					$lob_value = 'null';
 					break;
 			}
-
+			
 			// do we insert or update? => as for sesskey
 			$rs =& $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = $qkey");
 			ADODB_Session::_dumprs($rs);
@@ -788,10 +838,9 @@
 				$t = time();
 
 				if (abs($dbt - $t) >= $sync_seconds) {
-					global $HTTP_SERVER_VARS;
 					$msg = __FILE__ .
-						": Server time for webserver {$HTTP_SERVER_VARS['HTTP_HOST']} not in synch with database: " .
-						" database=$dbt ($dbts), webserver=$t (diff=". (abs($dbt - $t) / 3600) . ' hours)';
+						": Server time for webserver {$_SERVER['HTTP_HOST']} not in synch with database: " .
+						" database=$dbt ($dbts), webserver=$t (diff=". (abs($dbt - $t) / 60) . ' minutes)';
 					error_log($msg);
 					if ($debug) {
 						ADOConnection::outp("<p>$msg</p>");
@@ -802,7 +851,6 @@
 
 		return true;
 	}
-
 }
 
 ADODB_Session::_init();

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/benchmark.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/benchmark.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/benchmark.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+	<title>ADODB Benchmarks</title>
+</head> 
+
+<body>
+<?php 
+/*
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
+  
+  Benchmark code to test the speed to the ADODB library with different databases.
+  This is a simplistic benchmark to be used as the basis for further testing.
+  It should not be used as proof of the superiority of one database over the other.
+*/ 
+ 
+$testmssql = true;
+//$testvfp = true;
+$testoracle = true;
+$testado = true; 
+$testibase = true;
+$testaccess = true;
+$testmysql = true;
+$testsqlite = true;;
+
+set_time_limit(240); // increase timeout
+
+include("../tohtml.inc.php");
+include("../adodb.inc.php");
+
+function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
+{
+GLOBAL $ADODB_version,$ADODB_FETCH_MODE;
+
+	adodb_backtrace();
+	
+	$max = 100;
+	$sql = 'select * from ADOXYZ';
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	
+	//print "<h3>ADODB Version: $ADODB_version Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i></h3>";
+	
+	// perform query once to cache results so we are only testing throughput 
+	$rs = $db->Execute($sql);
+	if (!$rs){
+		print "Error in recordset<p>";
+		return;
+	}	
+	$arr = $rs->GetArray();
+	//$db->debug = true;
+	global $ADODB_COUNTRECS;
+	$ADODB_COUNTRECS = false;
+	$start = microtime();
+	for ($i=0; $i < $max; $i++) {
+		$rs =& $db->Execute($sql);	
+		$arr =& $rs->GetArray();
+	   //		 print $arr[0][1];
+	}
+	$end =  microtime();
+	$start = explode(' ',$start);
+	$end = explode(' ',$end);
+	
+	//print_r($start);
+	//print_r($end);
+	
+	  //  print_r($arr);
+	$total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
+	printf ("<p>seconds = %8.2f for %d iterations each with %d records</p>",$total,$max, sizeof($arr));
+	flush();
+
+
+		//$db->Close();
+}
+include("testdatabases.inc.php");
+
+?>
+
+
+</body>
+</html>

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/client.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/client.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/client.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,194 @@
+<html>
+<body bgcolor=white>
+<?php
+/** 
+ * V4.50 6 July 2004  (c) 2001-2002 John Lim (jlim at 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. 
+ * 
+ * set tabs to 8
+ */
+ 
+ // documentation on usage is at http://php.weblogs.com/adodb_csv
+ 
+include('../adodb.inc.php');
+include('../tohtml.inc.php');
+
+ function &send2server($url,$sql)
+ {
+	$url .= '?sql='.urlencode($sql);
+	print "<p>$url</p>";
+	$rs = csv2rs($url,$err);
+	if ($err) print $err;
+	return $rs;
+ }
+ 
+ function print_pre($s)
+ {
+ 	print "<pre>";print_r($s);print "</pre>";
+ }
+
+
+$serverURL = 'http://localhost/php/phplens/adodb/server.php';
+$testhttp = false;
+
+$sql1 = "insertz into products (productname) values ('testprod 1')";
+$sql2 = "insert into products (productname) values ('testprod 1')";
+$sql3 = "insert into products (productname) values ('testprod 2')";
+$sql4 = "delete from products where productid>80";
+$sql5 = 'select * from products';
+	
+if ($testhttp) {
+	print "<a href=#c>Client Driver Tests</a><p>";
+	print "<h3>Test Error</h3>";
+	$rs = send2server($serverURL,$sql1);
+	print_pre($rs);
+	print "<hr>";
+	
+	print "<h3>Test Insert</h3>";
+	
+	$rs = send2server($serverURL,$sql2);
+	print_pre($rs);
+	print "<hr>";
+	
+	print "<h3>Test Insert2</h3>";
+	
+	$rs = send2server($serverURL,$sql3);
+	print_pre($rs);
+	print "<hr>";
+	
+	print "<h3>Test Delete</h3>";
+	
+	$rs = send2server($serverURL,$sql4);
+	print_pre($rs);
+	print "<hr>";
+	
+	
+	print "<h3>Test Select</h3>";
+	$rs = send2server($serverURL,$sql5);
+	if ($rs) rs2html($rs);
+	
+	print "<hr>";
+}
+
+
+print "<a name=c><h1>CLIENT Driver Tests</h1>";
+$conn = ADONewConnection('csv');
+$conn->Connect($serverURL);
+$conn->debug = true;
+
+print "<h3>Bad SQL</h3>";
+
+$rs = $conn->Execute($sql1);
+
+print "<h3>Insert SQL 1</h3>";
+$rs = $conn->Execute($sql2);
+
+print "<h3>Insert SQL 2</h3>";
+$rs = $conn->Execute($sql3);
+
+print "<h3>Select SQL</h3>";
+$rs = $conn->Execute($sql5);
+if ($rs) rs2html($rs);
+
+print "<h3>Delete SQL</h3>";
+$rs = $conn->Execute($sql4);
+
+print "<h3>Select SQL</h3>";
+$rs = $conn->Execute($sql5);
+if ($rs) rs2html($rs);
+
+
+/* EXPECTED RESULTS FOR HTTP TEST:
+
+Test Insert
+http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
+
+adorecordset Object
+(
+	[dataProvider] => native
+	[fields] => 
+	[blobSize] => 64
+	[canSeek] => 
+	[EOF] => 1
+	[emptyTimeStamp] =>  
+	[emptyDate] =>  
+	[debug] => 
+	[timeToLive] => 0
+	[bind] => 
+	[_numOfRows] => -1
+	[_numOfFields] => 0
+	[_queryID] => 1
+	[_currentRow] => -1
+	[_closed] => 
+	[_inited] => 
+	[sql] => insert into products (productname) values ('testprod')
+	[affectedrows] => 1
+	[insertid] => 81
+)
+
+
+--------------------------------------------------------------------------------
+
+Test Insert2
+http://localhost/php/adodb/server.php?sql=insert+into+products+%28productname%29+values+%28%27testprod%27%29
+
+adorecordset Object
+(
+	[dataProvider] => native
+	[fields] => 
+	[blobSize] => 64
+	[canSeek] => 
+	[EOF] => 1
+	[emptyTimeStamp] =>  
+	[emptyDate] =>  
+	[debug] => 
+	[timeToLive] => 0
+	[bind] => 
+	[_numOfRows] => -1
+	[_numOfFields] => 0
+	[_queryID] => 1
+	[_currentRow] => -1
+	[_closed] => 
+	[_inited] => 
+	[sql] => insert into products (productname) values ('testprod')
+	[affectedrows] => 1
+	[insertid] => 82
+)
+
+
+--------------------------------------------------------------------------------
+
+Test Delete
+http://localhost/php/adodb/server.php?sql=delete+from+products+where+productid%3E80
+
+adorecordset Object
+(
+	[dataProvider] => native
+	[fields] => 
+	[blobSize] => 64
+	[canSeek] => 
+	[EOF] => 1
+	[emptyTimeStamp] =>  
+	[emptyDate] =>  
+	[debug] => 
+	[timeToLive] => 0
+	[bind] => 
+	[_numOfRows] => -1
+	[_numOfFields] => 0
+	[_queryID] => 1
+	[_currentRow] => -1
+	[_closed] => 
+	[_inited] => 
+	[sql] => delete from products where productid>80
+	[affectedrows] => 2
+	[insertid] => 0
+)
+
+[more stuff deleted]
+ .
+ . 
+ .
+*/
+?>

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/pdo.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/pdo.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/pdo.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,82 @@
+<?php
+error_reporting(E_ALL);
+include('../adodb.inc.php');
+
+try {
+	echo "New Connection\n";
+	$DB = NewADOConnection('pdo');
+	echo "Connect\n";
+	
+	$u = ''; $p = '';
+	/*
+	$connstr = 'odbc:nwind';
+	
+	$connstr = 'oci:';
+	$u = 'scott';
+	$p = 'natsoft';
+	
+	
+	$connstr ="sqlite:d:\inetpub\adodb\sqlite.db";
+	*/
+	
+	$connstr = "mysql:dbname=northwind";
+	$u = 'root';
+	
+	$connstr = "pgsql:dbname=test";
+	$u = 'tester';
+	$p = 'test';
+	
+	$DB->Connect($connstr,$u,$p) || die("CONNECT FAILED");
+	
+	
+	echo "$connstr: Execute\n";
+	
+	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$rs = $DB->Execute("select * from ADOXYZ where id<3");
+	echo "*** e=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";
+	
+	
+	//print_r(get_class_methods($DB->_stmt));
+	
+	if (!$rs) die("NO RS");
+	
+	echo "Meta\n";
+	for ($i=0; $i < $rs->NumCols(); $i++) {
+		var_dump($rs->FetchField($i));
+		echo "<br>";
+	}
+	
+	echo "FETCH\n";
+	$cnt = 0;
+	while (!$rs->EOF) {
+		adodb_pr($rs->fields); 
+		$rs->MoveNext();
+		if ($cnt++ > 1000) break;
+	}
+	
+	echo "<br>--------------------------------------------------------<br>\n\n\n";
+	
+	$stmt = $DB->PrepareStmt("select * from ADOXYZ");
+	
+	$rs = $stmt->Execute();
+	$cols = $stmt->NumCols(); // execute required
+	
+	echo "COLS = $cols";
+	for($i=1;$i<=$cols;$i++) {
+		$v = $stmt->_stmt->getColumnMeta($i);
+		var_dump($v);
+	}
+	
+	echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
+	while ($arr = $rs->FetchRow()) {
+		adodb_pr($arr);
+	}
+	die("DONE\n");
+
+} catch (exception $e) {
+	echo "<pre>";
+	echo $e;
+	echo "</pre>";
+}
+
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test-datadict.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-datadict.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test-datadict.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,248 @@
+<?php
+/*
+
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
+	
+  Set tabs to 4 for best viewing.
+
+*/
+
+error_reporting(E_ALL);
+include_once('../adodb.inc.php');
+
+foreach(array('sapdb','sybase','mysqlt','access','oci8','postgres','odbc_mssql','odbc','db2','firebird','informix') as $dbType) {
+	echo "<h3>$dbType</h3><p>";
+	$db = NewADOConnection($dbType);
+	$dict = NewDataDictionary($db);
+
+	if (!$dict) continue;
+	$dict->debug = 1;
+	
+	$opts = array('REPLACE','mysql' => 'TYPE=INNODB', 'oci8' => 'TABLESPACE USERS');
+	
+/*	$flds = array(
+		array('id',	'I',								
+							'AUTO','KEY'),
+							
+		array('name' => 'firstname', 'type' => 'varchar','size' => 30,
+							'DEFAULT'=>'Joan'),
+							
+		array('lastname','varchar',28,
+							'DEFAULT'=>'Chen','key'),
+							
+		array('averylonglongfieldname','X',1024,
+							'NOTNULL','default' => 'test'),
+							
+		array('price','N','7.2',
+							'NOTNULL','default' => '0.00'),
+							
+		array('MYDATE', 'D', 
+							'DEFDATE'),
+		array('TS','T',
+							'DEFTIMESTAMP')
+	);*/
+	
+	$flds = "
+ID            I           AUTO KEY,
+FIRSTNAME     VARCHAR(30) DEFAULT 'Joan',
+LASTNAME      VARCHAR(28) DEFAULT 'Chen' key,
+averylonglongfieldname X(1024) DEFAULT 'test',
+price         N(7.2)  DEFAULT '0.00',
+MYDATE        D      DEFDATE,
+BIGFELLOW     X      NOTNULL,
+TS            T      DEFTIMESTAMP";
+
+
+	$sqla = $dict->CreateDatabase('KUTU',array('postgres'=>"LOCATION='/u01/postdata'"));
+	$dict->SetSchema('KUTU');
+	
+	$sqli = ($dict->CreateTableSQL('testtable',$flds, $opts));
+	$sqla =& array_merge($sqla,$sqli);
+	
+	$sqli = $dict->CreateIndexSQL('idx','testtable','firstname,lastname',array('BITMAP','FULLTEXT','CLUSTERED','HASH'));
+	$sqla =& array_merge($sqla,$sqli);
+	$sqli = $dict->CreateIndexSQL('idx2','testtable','price,lastname');//,array('BITMAP','FULLTEXT','CLUSTERED'));
+	$sqla =& array_merge($sqla,$sqli);
+	
+	$addflds = array(array('height', 'F'),array('weight','F'));
+	$sqli = $dict->AddColumnSQL('testtable',$addflds);
+	$sqla =& array_merge($sqla,$sqli);
+	$addflds = array(array('height', 'F','NOTNULL'),array('weight','F','NOTNULL'));
+	$sqli = $dict->AlterColumnSQL('testtable',$addflds);
+	$sqla =& array_merge($sqla,$sqli);
+	
+	
+	printsqla($dbType,$sqla);
+	
+	if (file_exists('d:\inetpub\wwwroot\php\phplens\adodb\adodb.inc.php'))
+	if ($dbType == 'mysqlt') {
+		$db->Connect('localhost', "root", "", "test");
+		$dict->SetSchema('');
+		$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
+		if ($sqla2) printsqla($dbType,$sqla2);
+	}
+	if ($dbType == 'postgres') {
+		if (@$db->Connect('localhost', "tester", "test", "test"));
+		$dict->SetSchema('');
+		$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
+		if ($sqla2) printsqla($dbType,$sqla2);
+	}
+	
+	if ($dbType == 'odbc_mssql') {
+		$dsn = $dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=localhost;Database=northwind;";
+		if (@$db->Connect($dsn, "sa", "natsoft", "test"));
+		$dict->SetSchema('');
+		$sqla2 = $dict->ChangeTableSQL('adoxyz',$flds);
+		if ($sqla2) printsqla($dbType,$sqla2);
+	}
+	
+	
+	
+	adodb_pr($dict->databaseType);
+	printsqla($dbType, $dict->DropColumnSQL('table',array('`col`','col2')));
+	printsqla($dbType, $dict->ChangeTableSQL('adoxyz','LASTNAME varchar(32)'));
+	
+}
+
+function printsqla($dbType,$sqla)
+{
+	print "<pre>";
+	//print_r($dict->MetaTables());
+	foreach($sqla as $s) {
+		$s = htmlspecialchars($s);
+		print "$s;\n";
+		if ($dbType == 'oci8') print "/\n";
+	}
+	print "</pre><hr>";
+}
+
+/***
+
+Generated SQL:
+
+mysql
+
+CREATE DATABASE KUTU;
+DROP TABLE KUTU.testtable;
+CREATE TABLE KUTU.testtable (
+id               INTEGER NOT NULL AUTO_INCREMENT,
+firstname        VARCHAR(30) DEFAULT 'Joan',
+lastname         VARCHAR(28) NOT NULL DEFAULT 'Chen',
+averylonglongfieldname LONGTEXT NOT NULL,
+price            NUMERIC(7,2) NOT NULL DEFAULT 0.00,
+MYDATE           DATE DEFAULT CURDATE(),
+                 PRIMARY KEY (id, lastname)
+)TYPE=ISAM;
+CREATE FULLTEXT INDEX idx ON KUTU.testtable (firstname,lastname);
+CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
+ALTER TABLE KUTU.testtable  ADD height           DOUBLE;
+ALTER TABLE KUTU.testtable  ADD weight           DOUBLE;
+ALTER TABLE KUTU.testtable  MODIFY COLUMN height           DOUBLE NOT NULL;
+ALTER TABLE KUTU.testtable  MODIFY COLUMN weight           DOUBLE NOT NULL;
+
+
+--------------------------------------------------------------------------------
+
+oci8
+
+CREATE USER KUTU IDENTIFIED BY tiger;
+/
+GRANT CREATE SESSION, CREATE TABLE,UNLIMITED TABLESPACE,CREATE SEQUENCE TO KUTU;
+/
+DROP TABLE KUTU.testtable CASCADE CONSTRAINTS;
+/
+CREATE TABLE KUTU.testtable (
+id               NUMBER(16) NOT NULL,
+firstname        VARCHAR(30) DEFAULT 'Joan',
+lastname         VARCHAR(28) DEFAULT 'Chen' NOT NULL,
+averylonglongfieldname CLOB NOT NULL,
+price            NUMBER(7,2) DEFAULT 0.00 NOT NULL,
+MYDATE           DATE DEFAULT TRUNC(SYSDATE),
+                 PRIMARY KEY (id, lastname)
+)TABLESPACE USERS;
+/
+DROP SEQUENCE KUTU.SEQ_testtable;
+/
+CREATE SEQUENCE KUTU.SEQ_testtable;
+/
+CREATE OR REPLACE TRIGGER KUTU.TRIG_SEQ_testtable BEFORE insert ON KUTU.testtable 
+		FOR EACH ROW
+		BEGIN
+		  select KUTU.SEQ_testtable.nextval into :new.id from dual;
+		END;
+/
+CREATE BITMAP INDEX idx ON KUTU.testtable (firstname,lastname);
+/
+CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
+/
+ALTER TABLE testtable ADD (
+ height           NUMBER,
+ weight           NUMBER);
+/
+ALTER TABLE testtable MODIFY(
+ height           NUMBER NOT NULL,
+ weight           NUMBER NOT NULL);
+/
+
+
+--------------------------------------------------------------------------------
+
+postgres
+AlterColumnSQL not supported for PostgreSQL
+
+
+CREATE DATABASE KUTU LOCATION='/u01/postdata';
+DROP TABLE KUTU.testtable;
+CREATE TABLE KUTU.testtable (
+id               SERIAL,
+firstname        VARCHAR(30) DEFAULT 'Joan',
+lastname         VARCHAR(28) DEFAULT 'Chen' NOT NULL,
+averylonglongfieldname TEXT NOT NULL,
+price            NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
+MYDATE           DATE DEFAULT CURRENT_DATE,
+                 PRIMARY KEY (id, lastname)
+);
+CREATE INDEX idx ON KUTU.testtable USING HASH (firstname,lastname);
+CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
+ALTER TABLE KUTU.testtable  ADD height           FLOAT8;
+ALTER TABLE KUTU.testtable  ADD weight           FLOAT8;
+
+
+--------------------------------------------------------------------------------
+
+odbc_mssql
+
+CREATE DATABASE KUTU;
+DROP TABLE KUTU.testtable;
+CREATE TABLE KUTU.testtable (
+id               INT IDENTITY(1,1) NOT NULL,
+firstname        VARCHAR(30) DEFAULT 'Joan',
+lastname         VARCHAR(28) DEFAULT 'Chen' NOT NULL,
+averylonglongfieldname TEXT NOT NULL,
+price            NUMERIC(7,2) DEFAULT 0.00 NOT NULL,
+MYDATE           DATETIME DEFAULT GetDate(),
+                 PRIMARY KEY (id, lastname)
+);
+CREATE CLUSTERED INDEX idx ON KUTU.testtable (firstname,lastname);
+CREATE INDEX idx2 ON KUTU.testtable (price,lastname);
+ALTER TABLE KUTU.testtable  ADD
+ height           REAL,
+ weight           REAL;
+ALTER TABLE KUTU.testtable  ALTER COLUMN height           REAL NOT NULL;
+ALTER TABLE KUTU.testtable  ALTER COLUMN weight           REAL NOT NULL;
+
+
+--------------------------------------------------------------------------------
+*/
+
+
+echo "<h1>Test XML Schema</h1>";
+$ff = file('xmlschema.xml');
+echo "<pre>";
+foreach($ff as $xml) echo htmlspecialchars($xml);
+echo "</pre>";
+include_once('test-xmlschema.php');
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test-perf.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-perf.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test-perf.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,50 @@
+<?php
+
+include_once('../adodb-perf.inc.php');
+
+error_reporting(E_ALL);
+session_start();
+
+if (isset($_GET)) {
+	foreach($_GET as $k => $v) {
+		if (strncmp($k,'test',4) == 0) $_SESSION['_db'] = $k;
+	}
+} 
+
+if (isset($_SESSION['_db'])) {
+	$_db = $_SESSION['_db'];
+	$_GET[$_db] = 1;
+	$$_db = 1;
+}
+
+echo "<h1>Performance Monitoring</h1>";
+include_once('testdatabases.inc.php');
+
+
+function testdb($db) 
+{
+	if (!$db) return;
+	echo "<font size=1>";print_r($db->ServerInfo()); echo " user=".$db->user."</font>";
+	
+	$perf = NewPerfMonitor($db); 
+	
+	# unit tests
+	if (0) {
+		//$DB->debug=1;
+		echo "Data Cache Size=".$perf->DBParameter('data cache size').'<p>';
+		echo $perf->HealthCheck();
+		echo($perf->SuspiciousSQL());
+		echo($perf->ExpensiveSQL());
+		echo($perf->InvalidSQL());
+		echo $perf->Tables();
+	
+		echo "<pre>";
+		echo $perf->HealthCheckCLI();
+		$perf->Poll(3);
+		die();
+	}
+	
+	if ($perf) $perf->UI(3);
+}
+ 
+?>

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test-pgblob.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-pgblob.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test-pgblob.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,88 @@
+<?php
+
+function getmicrotime()
+{
+	$t = microtime();
+	$t = explode(' ',$t);
+	return (float)$t[1]+ (float)$t[0];
+}
+
+function doloop()
+{
+global $db,$MAX;
+	
+	$sql = "select id,firstname,lastname from adoxyz where 
+		firstname not like ? and lastname not like ? and id=?";
+	$offset = 0;
+	/*$sql = "select * from juris9.employee join juris9.emp_perf_plan on epp_empkey = emp_id 
+		where emp_name not like ? and emp_name not like ? and emp_id=28000+?";
+	$offset = 28000;*/
+	for ($i=1; $i <= $MAX; $i++) {
+		$db->Param(false);
+		$x = (rand() % 10) + 1;
+		$db->debug= ($i==1);
+		$id = $db->GetOne($sql,
+			array('Z%','Z%',$x));
+		if($id != $offset+$x) {
+			print "<p>Error at $x";
+			break;
+		}
+	}
+}
+
+include_once('../adodb.inc.php');
+$db = NewADOConnection('postgres7');
+$db->PConnect('localhost','tester','test','test') || die("failed connection");
+
+$enc = "GIF89a%01%00%01%00%80%FF%00%C0%C0%C0%00%00%00%21%F9%04%01%00%00%00%00%2C%00%00%00%00%01%00%01%00%00%01%012%00%3Bt_clear.gif%0D";
+$val = rawurldecode($enc);
+
+$MAX = 1000;
+
+adodb_pr($db->ServerInfo());
+
+echo "<h4>Testing PREPARE/EXECUTE PLAN</h4>";
+
+
+$db->_bindInputArray = true; // requires postgresql 7.3+ and ability to modify database
+$t = getmicrotime();
+doloop();
+echo '<p>',$MAX,' times, with plan=',getmicrotime() - $t,'</p>';
+
+
+$db->_bindInputArray = false;
+$t = getmicrotime();
+doloop();
+echo '<p>',$MAX,' times, no plan=',getmicrotime() - $t,'</p>';
+
+
+
+echo "<h4>Testing UPDATEBLOB</h4>";
+$db->debug=1;
+
+### TEST BEGINS
+
+$db->Execute("insert into photos (id,name) values(9999,'dot.gif')");
+$db->UpdateBlob('photos','photo',$val,'id=9999');
+$v = $db->GetOne('select photo from photos where id=9999');
+
+
+### CLEANUP
+
+$db->Execute("delete from photos where id=9999");
+
+### VALIDATION
+
+if ($v !== $val) echo "<b>*** ERROR: Inserted value does not match downloaded val<b>";
+else echo "<b>*** OK: Passed</b>";
+
+echo "<pre>";
+echo "INSERTED: ", $enc;
+echo "<hr>";
+echo"RETURNED: ", rawurlencode($v);
+echo "<hr><p>";
+echo "INSERTED: ", $val;
+echo "<hr>";
+echo "RETURNED: ", $v;
+
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test-php5.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-php5.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test-php5.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,78 @@
+<?php
+/*
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
+  Set tabs to 8.
+ */
+
+
+error_reporting(E_ALL);
+
+$path = dirname(__FILE__);
+
+include("$path/../adodb-exceptions.inc.php");
+include("$path/../adodb.inc.php");	
+
+echo "<h3>PHP ".PHP_VERSION."</h3>\n";
+try {
+
+$dbt = 'mysql';
+
+try {
+switch($dbt) {
+case 'oci8po':
+	$db = NewADOConnection("oci8po");
+	
+	$db->Connect('','scott','natsoft');
+	break;
+default:
+case 'mysql':
+	$db = NewADOConnection("mysql");
+	$db->Connect('localhost','roots','','northwind');
+	break;
+	
+case 'mysqli':
+	$db = NewADOConnection("mysqli://root:@localhost/northwind");
+	//$db->Connect('localhost','root','','test');
+	break;
+}
+} catch (exception $e){
+	echo "Connect Failed";
+	adodb_pr($e);
+	die();
+}
+
+$db->debug=1;
+
+$cnt = $db->GetOne("select count(*) from adoxyz where ?<id and id<?",array(10,20));
+$stmt = $db->Prepare("select * from adoxyz where ?<id and id<?");
+if (!$stmt) echo $db->ErrorMsg(),"\n";
+$rs = $db->Execute($stmt,array(10,20));
+
+echo  "<hr> Foreach Iterator Test (rand=".rand().")<hr>";
+$i = 0;
+foreach($rs as $v) {
+	$i += 1;
+	echo "rec $i: "; $s1 = adodb_pr($v,true); $s2 = adodb_pr($rs->fields,true);
+	if ($s1 != $s2 && !empty($v)) {adodb_pr($s1); adodb_pr($s2);}
+	else echo "passed<br>";
+	flush();
+}
+
+
+if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
+else echo "Count $i is correct<br>";
+
+$rs = $db->Execute("select bad from badder");
+
+} catch (exception $e) {
+	adodb_pr($e);
+	echo "<h3>adodb_backtrace:</h3>\n";
+	$e = adodb_backtrace($e->gettrace());
+}
+
+$rs = $db->Execute("select distinct id, firstname,lastname from adoxyz order by id");
+echo "Result=\n",$rs;
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test-xmlschema.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test-xmlschema.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test-xmlschema.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,54 @@
+<?PHP
+
+// V4.50 6 July 2004
+
+error_reporting(E_ALL);
+include_once( "../adodb.inc.php" );
+include_once( "../adodb-xmlschema.inc.php" );
+
+// To build the schema, start by creating a normal ADOdb connection:
+$db = ADONewConnection( 'mysql' );
+$db->Connect( 'localhost', 'root', '', 'schematest' );
+
+// To create a schema object and build the query array.
+$schema = new adoSchema( $db );
+
+// To upgrade an existing schema object, use the following 
+// To upgrade an existing database to the provided schema,
+// uncomment the following line:
+#$schema->upgradeSchema();
+
+print "<b>SQL to build xmlschema.xml</b>:\n<pre>";
+// Build the SQL array
+$sql = $schema->ParseSchema( "xmlschema.xml" );
+
+print_r( $sql );
+print "</pre>\n";
+
+// Execute the SQL on the database
+//$result = $schema->ExecuteSchema( $sql );
+
+// Finally, clean up after the XML parser
+// (PHP won't do this for you!)
+//$schema->Destroy();
+
+
+
+print "<b>SQL to build xmlschema-mssql.xml</b>:\n<pre>";
+
+$db2 = ADONewConnection('mssql');
+$db2->Connect('','adodb','natsoft','northwind') || die("Fail 2");
+
+$db2->Execute("drop table simple_table");
+
+$schema = new adoSchema( $db2 );
+$sql = $schema->ParseSchema( "xmlschema-mssql.xml" );
+
+print_r( $sql );
+print "</pre>\n";
+
+$db2->debug=1;
+
+foreach ($sql as $s)
+$db2->Execute($s);
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,1650 @@
+<?php
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+
+error_reporting(E_ALL);
+
+$ADODB_FLUSH = true;
+
+define('ADODB_ASSOC_CASE',0);
+
+if (PHP_VERSION < 5) include_once('../adodb-pear.inc.php');
+//--------------------------------------------------------------------------------------
+//define('ADODB_ASSOC_CASE',1);
+//
+function Err($msg)
+{
+	print "<b>$msg</b><br>";
+	flush();
+}
+
+function CheckWS($conn)
+{
+global $ADODB_EXTENSION;
+
+	include_once('../session/adodb-session.php');
+	if (defined('CHECKWSFAIL')){ echo " TESTING $conn ";flush();}
+	$saved = $ADODB_EXTENSION;
+	$db = ADONewConnection($conn);
+	$ADODB_EXTENSION = $saved;
+	if (headers_sent()) {
+		print "<p><b>White space detected in adodb-$conn.inc.php or include file...</b></p>";
+		//die();
+	}
+}
+
+function do_strtolower(&$arr)
+{
+	foreach($arr as $k => $v) {
+		if (is_object($v)) $arr[$k] = adodb_pr($v,true);
+		else $arr[$k] = strtolower($v);
+	}
+}
+
+
+function CountExecs($db, $sql, $inputarray)
+{
+global $EXECS;  $EXECS++;
+}
+
+function CountCachedExecs($db, $secs2cache, $sql, $inputarray)
+{
+global $CACHED; $CACHED++;
+}
+
+// the table creation code is specific to the database, so we allow the user 
+// to define their own table creation stuff
+
+function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
+{
+GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE,$ADODB_COUNTRECS;
+
+?>	<form method=GET>
+	</p>
+	<table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
+	</p>
+<?php  
+	$create =false;
+	/*$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	
+	$rs = $db->Execute('select lastname,firstname,lastname,id from adoxyz');
+	$arr = $rs->GetAssoc();
+	echo "<pre>";print_r($arr);
+	die();*/
+	
+	GLOBAL $EXECS, $CACHED;
+	
+	$EXECS = 0;
+	$CACHED = 0;
+	//$db->Execute("drop table adodb_logsql");
+	if ((rand()%3) == 0) @$db->Execute("delete from adodb_logsql");
+	$db->debug=1;
+	
+	$db->fnExecute = 'CountExecs';
+	$db->fnCacheExecute = 'CountCachedExecs';
+	
+	if (empty($_GET['nolog'])) {
+		echo "<h3>SQL Logging enabled</h3>";
+		$db->LogSQL();/*
+		$sql =
+"SELECT t1.sid, t1.sid, t1.title, t1.hometext, t1.notes, t1.aid, t1.informant, 
+t2.url, t2.email, t1.catid, t3.title, t1.topic, t4.topicname, t4.topicimage, 
+t4.topictext, t1.score, t1.ratings, t1.counter, t1.comments, t1.acomm 
+FROM `nuke_stories` `t1`, `nuke_authors` `t2`, `nuke_stories_cat` `t3`, `nuke_topics` `t4` 
+	WHERE ((t2.aid=t1.aid) AND (t3.catid=t1.catid) AND (t4.topicid=t1.topic) 
+	AND ((t1.alanguage='german') OR (t1.alanguage='')) AND (t1.ihome='0')) 
+	ORDER BY t1.time DESC";
+		$db->SelectLimit($sql);
+		echo $db->ErrorMsg();*/
+	}
+	$ADODB_CACHE_DIR = dirname(TempNam('/tmp','testadodb'));
+	$db->debug = false;
+	//print $db->UnixTimeStamp('2003-7-22 23:00:00');
+	
+	$phpv = phpversion();
+	if (defined('ADODB_EXTENSION')) $ext = ' &nbsp; Extension '.ADODB_EXTENSION.' installed';
+	else $ext = '';
+	print "<h3>ADODB Version: $ADODB_vers Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i> &nbsp; PHP: $phpv $ext</h3>";
+	flush();
+
+	
+	$arr = $db->ServerInfo();
+	print_r($arr);
+	echo "<br>";
+	$e = error_reporting(E_ALL-E_WARNING);
+	flush();
+	
+	$tt  = $db->Time(); 
+	if ($tt == 0) echo '<br><b>$db->Time failed</b>';
+	else echo "<br>db->Time: ".date('d-m-Y H:i:s',$tt);
+	echo '<br>';
+	
+	echo "Date=",$db->UserDate('2002-04-07'),'<br>';
+	print "<i>date1</i> (1969-02-20) = ".$db->DBDate('1969-2-20');
+	print "<br><i>date1</i> (1999-02-20) = ".$db->DBDate('1999-2-20');
+	print "<br><i>date1.1</i> 1999 = ".$db->DBDate("'1999'");
+	print "<br><i>date2</i> (1970-1-2) = ".$db->DBDate(24*3600)."<p>";
+	print "<i>ts1</i> (1999-02-20 13:40:50) = ".$db->DBTimeStamp('1999-2-20 1:40:50 pm');
+	print "<br><i>ts1.1</i> (1999-02-20 13:40:00) = ".$db->DBTimeStamp('1999-2-20 13:40');
+	print "<br><i>ts2</i> (1999-02-20) = ".$db->DBTimeStamp('1999-2-20');
+	print "<br><i>ts3</i> (1970-1-2 +/- timezone) = ".$db->DBTimeStamp(24*3600);
+	print "<br> Fractional TS (1999-2-20 13:40:50.91): ".$db->DBTimeStamp($db->UnixTimeStamp('1999-2-20 13:40:50.91+1'));
+	 $dd = $db->UnixDate('1999-02-20');
+	print "<br>unixdate</i> 1999-02-20 = ".date('Y-m-d',$dd)."<p>";
+	print "<br><i>ts4</i> =".($db->UnixTimeStamp("19700101000101")+8*3600);
+	print "<br><i>ts5</i> =".$db->DBTimeStamp($db->UnixTimeStamp("20040110092123"));
+	print "<br><i>ts6</i> =".$db->UserTimeStamp("20040110092123");
+	print "<br><i>ts7</i> =".$db->DBTimeStamp("20040110092123");
+	flush();
+	// mssql too slow in failing bad connection
+	if (false && $db->databaseType != 'mssql') {
+		print "<p>Testing bad connection. Ignore following error msgs:<br>";
+		$db2 = ADONewConnection();
+		$rez = $db2->Connect("bad connection");
+		$err = $db2->ErrorMsg();
+		print "<i>Error='$err'</i></p>";
+		if ($rez) print "<b>Cannot check if connection failed.</b> The Connect() function returned true.</p>";
+	}
+	error_reporting($e);
+	flush();
+
+	//$ADODB_COUNTRECS=false;
+	$rs=$db->Execute('select * from adoxyz order by id');
+	if($rs === false) $create = true;
+	else $rs->Close();
+	
+	//if ($db->databaseType !='vfp') $db->Execute("drop table ADOXYZ");
+	
+	if ($create) {
+		if (false && $db->databaseType == 'ibase') {
+			print "<b>Please create the following table for testing:</b></p>$createtab</p>";
+			return;
+		} else {
+			$db->debug = 1;
+			$e = error_reporting(E_ALL-E_WARNING);
+			$db->Execute($createtab);
+			error_reporting($e);
+		}
+	}
+	$rs = &$db->Execute("delete from ADOXYZ"); // some ODBC drivers will fail the drop so we delete
+	if ($rs) {
+		if(! $rs->EOF) print "<b>Error: </b>RecordSet returned by Execute('delete...') should show EOF</p>";
+		$rs->Close();
+	} else print "err=".$db->ErrorMsg();
+
+	print "<p>Test select on empty table, FetchField when EOF, and GetInsertSQL</p>";
+	$rs = &$db->Execute("select id,firstname from ADOXYZ where id=9999");
+	if ($rs && !$rs->EOF) print "<b>Error: </b>RecordSet returned by Execute(select...') on empty table should show EOF</p>";
+	if ($rs->EOF && (($ox = $rs->FetchField(0)) && !empty($ox->name))) {
+		$record['id'] = 99;
+		$record['firstname'] = 'John';
+		$sql =  $db->GetInsertSQL($rs, $record);
+		if (strtoupper($sql) != strtoupper("INSERT INTO ADOXYZ ( id, firstname ) VALUES ( 99, 'John' )")) Err("GetInsertSQL does not work on empty table: $sql");
+	} else {
+		Err("FetchField does not work on empty recordset, meaning GetInsertSQL will fail...");
+	}
+	if ($rs) $rs->Close();
+	flush();
+	//$db->debug=true;	
+	print "<p>Testing Commit: ";
+	$time = $db->DBDate(time());
+	if (!$db->BeginTrans()) {
+		print '<b>Transactions not supported</b></p>';
+		if ($db->hasTransactions) Err("hasTransactions should be false");
+	} else { /* COMMIT */
+		if (!$db->hasTransactions) Err("hasTransactions should be true");
+		if ($db->transCnt != 1) Err("Invalid transCnt = $db->transCnt (should be 1)");
+		$rs = $db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values (99,'Should Not','Exist (Commit)',$time)");
+		if ($rs && $db->CommitTrans()) {
+			$rs->Close();
+			$rs = &$db->Execute("select * from ADOXYZ where id=99");
+			if ($rs === false || $rs->EOF) {
+				print '<b>Data not saved</b></p>';
+				$rs = &$db->Execute("select * from ADOXYZ where id=99");
+				print_r($rs);
+				die();
+			} else print 'OK</p>';
+			if ($rs) $rs->Close();
+		} else {
+			if (!$rs) {
+				print "<b>Insert failed</b></p>";
+				$db->RollbackTrans();
+			} else print "<b>Commit failed</b></p>";
+		}
+		if ($db->transCnt != 0) Err("Invalid transCnt = $db->transCnt (should be 0)");
+		
+		/* ROLLBACK */	
+		if (!$db->BeginTrans()) print "<p><b>Error in BeginTrans</b>()</p>";
+		print "<p>Testing Rollback: ";
+		$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values (100,'Should Not','Exist (Rollback)',$time)");
+		if ($db->RollbackTrans()) {
+			$rs = $db->Execute("select * from ADOXYZ where id=100");
+			if ($rs && !$rs->EOF) print '<b>Fail: Data should rollback</b></p>';
+			else print 'OK</p>';
+			if ($rs) $rs->Close();
+		} else
+			print "<b>Commit failed</b></p>";
+			
+		$rs = &$db->Execute('delete from ADOXYZ where id>50');
+		if ($rs) $rs->Close();
+		
+		if ($db->transCnt != 0) Err("Invalid transCnt = $db->transCnt (should be 0)");
+	}
+	
+	if (1) {
+		print "<p>Testing MetaDatabases()</p>";
+		print_r( $db->MetaDatabases());
+
+		print "<p>Testing MetaTables() and MetaColumns()</p>";
+		$a = $db->MetaTables();
+		if ($a===false) print "<b>MetaTables not supported</b></p>";
+		else {
+			print "Array of tables and views: "; 
+			foreach($a as $v) print " ($v) ";
+			print '</p>';
+		}
+		
+		$a = $db->MetaTables('VIEW');
+		if ($a===false) print "<b>MetaTables not supported (views)</b></p>";
+		else {
+			print "Array of views: "; 
+			foreach($a as $v) print " ($v) ";
+			print '</p>';
+		}
+		
+		$a = $db->MetaTables(false,false,'aDo%');
+		if ($a===false) print "<b>MetaTables not supported (mask)</b></p>";
+		else {
+			print "Array of ado%: "; 
+			foreach($a as $v) print " ($v) ";
+			print '</p>';
+		}
+		
+		$a = $db->MetaTables('TABLE');
+		if ($a===false) print "<b>MetaTables not supported</b></p>";
+		else {
+			print "Array of tables: "; 
+			foreach($a as $v) print " ($v) ";
+			print '</p>';
+		}
+		
+		$db->debug=0;
+		$rez = $db->MetaColumns("NOSUCHTABLEHERE");
+		if ($rez !== false) {
+			Err("MetaColumns error handling failed");
+			var_dump($rez);
+		}
+		$db->debug=1;
+		$a = $db->MetaColumns('ADOXYZ');
+		if ($a===false) print "<b>MetaColumns not supported</b></p>";
+		else {
+			print "<p>Columns of ADOXYZ: <font size=1><br>";
+			foreach($a as $v) {print_r($v); echo "<br>";}
+			echo "</font>";
+		}
+		
+		print "<p>Testing MetaIndexes</p>";
+		
+		$a = $db->MetaIndexes(('ADOXYZ'),true);
+		if ($a===false) print "<b>MetaIndexes not supported</b></p>";
+		else {
+			print "<p>Indexes of ADOXYZ: <font size=1><br>";
+			adodb_pr($a);
+			echo "</font>";
+		}
+		print "<p>Testing MetaPrimaryKeys</p>";
+		$a = $db->MetaPrimaryKeys('ADOXYZ');
+		var_dump($a);
+	}
+	$rs = &$db->Execute('delete from ADOXYZ');
+	if ($rs) $rs->Close();
+	
+	$db->debug = false;
+	
+	
+	switch ($db->databaseType) {
+	case 'vfp':
+		
+		if (0) {
+			// memo test
+			$rs = $db->Execute("select data from memo");
+			rs2html($rs);
+		}
+		break;
+
+	case 'postgres7':
+	case 'postgres64':
+	case 'postgres':
+	case 'ibase':
+		print "<p>Encode=".$db->BlobEncode("abc\0d\"'
+ef")."</p>";//'
+
+		print "<p>Testing Foreign Keys</p>";
+		$arr = $db->MetaForeignKeys('adoxyz',false,true);
+		print_r($arr);
+		if (!$arr) Err("Bad MetaForeignKeys");
+		break;
+	
+	case 'odbc_mssql':
+	case 'mssqlpo':
+		print "<p>Testing Foreign Keys</p>";
+		$arr = $db->MetaForeignKeys('Orders',false,true);
+		print_r($arr);
+		if (!$arr) Err("Bad MetaForeignKeys");
+		if ($db->databaseType == 'odbc_mssql') break;
+	
+	case 'mssql': 
+	
+		
+/*
+ASSUME Northwind available...
+
+CREATE PROCEDURE SalesByCategory
+	@CategoryName nvarchar(15), @OrdYear nvarchar(4) = '1998'
+AS
+IF @OrdYear != '1996' AND @OrdYear != '1997' AND @OrdYear != '1998' 
+BEGIN
+	SELECT @OrdYear = '1998'
+END
+
+SELECT ProductName,
+	TotalPurchase=ROUND(SUM(CONVERT(decimal(14,2), OD.Quantity * (1-OD.Discount) * OD.UnitPrice)), 0)
+FROM [Order Details] OD, Orders O, Products P, Categories C
+WHERE OD.OrderID = O.OrderID 
+	AND OD.ProductID = P.ProductID 
+	AND P.CategoryID = C.CategoryID
+	AND C.CategoryName = @CategoryName
+	AND SUBSTRING(CONVERT(nvarchar(22), O.OrderDate, 111), 1, 4) = @OrdYear
+GROUP BY ProductName
+ORDER BY ProductName
+GO
+
+
+CREATE PROCEDURE ADODBTestSP
+ at a nvarchar(25)
+AS
+SELECT GETDATE() AS T, @a AS A
+GO
+*/
+		print "<h4>Testing Stored Procedures for mssql</h4>";
+		$saved = $db->debug;
+		$db->debug=true;
+		
+		$cmd = $db->PrepareSP('ADODBTestSP');
+		$ss = "You should see me in the output.";
+		$db->InParameter($cmd,$ss,'a');
+		$rs = $db->Execute($cmd);
+		echo $rs->fields['T']." --- ".$rs->fields['A']."---<br>";
+
+		$cat = 'Dairy Products';
+		$yr = '1998';
+		
+		$stmt = $db->PrepareSP('SalesByCategory');
+		$db->InParameter($stmt,$cat,'CategoryName');
+		$db->InParameter($stmt,$yr,'OrdYear');
+		$rs = $db->Execute($stmt);
+		rs2html($rs);
+		
+		$cat = 'Grains/Cereals';
+		$yr = 1998;
+		
+		$stmt = $db->PrepareSP('SalesByCategory');
+		$db->InParameter($stmt,$cat,'CategoryName');
+		$db->InParameter($stmt,$yr,'OrdYear');
+		$rs = $db->Execute($stmt);
+		rs2html($rs);
+		
+		/*
+		Test out params - works in PHP 4.2.3 and 4.3.3 and 4.3.8 but not 4.3.0:
+		
+			CREATE PROCEDURE at_date_interval 
+				@days INTEGER, 
+				@start VARCHAR(20) OUT, 
+				@end VARCHAR(20) OUT 	
+			AS 
+			BEGIN 
+				set @start = CONVERT(VARCHAR(20), getdate(), 101) 
+				set @end =CONVERT(VARCHAR(20), dateadd(day, @days, getdate()), 101 ) 
+			END
+			GO
+		*/
+		$db->debug=1;
+		$stmt = $db->PrepareSP('at_date_interval');
+		$days = 10;
+		$begin_date = '';
+		$end_date = '';
+		$db->InParameter($stmt,$days,'days', 4, SQLINT4); 
+		$db->OutParameter($stmt,$begin_date,'start', 20, SQLVARCHAR ); 
+		$db->OutParameter($stmt,$end_date,'end', 20, SQLVARCHAR ); 
+		$db->Execute($stmt);
+		if (empty($begin_date) or empty($end_date) or $begin_date == $end_date) {
+			Err("MSSQL SP Test for OUT Failed");
+			print "begin=$begin_date end=$end_date<p>";
+		} else print "(Today +10days) = (begin=$begin_date end=$end_date)<p>";
+	
+		$db->debug = $saved;
+		break;
+	case 'oci8': 
+	case 'oci8po':
+		
+		# cleanup
+		$db->Execute("delete from photos where id=99 or id=1");
+		$db->Execute("insert into photos (id) values(1)");
+		$db->Execute("update photos set photo=null,descclob=null where id=1");
+		
+		$saved = $db->debug;
+		$db->debug=true;
+		
+		
+
+		/*
+		CREATE TABLE PHOTOS
+		(
+		  ID           NUMBER(16),
+		  PHOTO        BLOB,
+		  DESCRIPTION  VARCHAR2(4000 BYTE),
+		  DESCCLOB     CLOB
+		);
+		
+		INSERT INTO PHOTOS (ID) VALUES(1);
+		*/
+		$s = '';
+		for ($i = 0; $i <= 500; $i++) {
+			$s .= '1234567890';
+		}
+		
+		$sql = "INSERT INTO photos ( ID, photo) ".
+			"VALUES ( :id, empty_blob() )".
+			" RETURNING photo INTO :xx";
+
+		
+		$blob_data = $s;
+		$id = 99;
+		
+ 		$stmt = $db->PrepareSP($sql);
+		$db->InParameter($stmt, $id, 'id');
+		$blob = $db->InParameter($stmt, $s, 'xx',-1, OCI_B_BLOB);
+		$db->StartTrans();
+		$result = $db->Execute($stmt);
+		$db->CompleteTrans();
+		
+		$s2= $db->GetOne("select photo from photos where id=99");
+		echo "<br>---$s2";
+		if ($s !== $s2) Err("insert blob does not match");
+
+		print "<h4>Testing Blob: size=".strlen($s)."</h4>";
+		$ok = $db->Updateblob('photos','photo',$s,'id=1');
+		if (!$ok) Err("Blob failed 1");
+		else {
+			$s2= $db->GetOne("select photo from photos where id=1");
+			if ($s !== $s2) Err("updateblob does not match");
+		}
+		
+		print "<h4>Testing Clob: size=".strlen($s)."</h4>";
+		$ok = $db->UpdateClob('photos','descclob',$s,'id=1');
+		if (!$ok) Err("Clob failed 1");
+		else {
+			$s2= $db->GetOne("select descclob from photos where id=1");
+			if ($s !== $s2) Err("updateclob does not match");
+		}
+		
+		
+		$s = '';
+		$s2 = '';
+		print "<h4>Testing Foreign Keys</h4>";
+		$arr = $db->MetaForeignKeys('emp');
+		print_r($arr);
+		if (!$arr) Err("Bad MetaForeignKeys");
+/*
+-- TEST PACKAGE
+-- "Set scan off" turns off substitution variables. 
+Set scan off; 
+
+CREATE OR REPLACE PACKAGE Adodb AS
+TYPE TabType IS REF CURSOR RETURN TAB%ROWTYPE;
+PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames IN VARCHAR);
+PROCEDURE open_tab2 (tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) ;
+PROCEDURE data_out(input IN VARCHAR, output OUT VARCHAR);
+PROCEDURE data_in(input IN VARCHAR);
+PROCEDURE myproc (p1 IN NUMBER, p2 OUT NUMBER);
+END Adodb;
+/
+
+
+CREATE OR REPLACE PACKAGE BODY Adodb AS
+PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames IN VARCHAR) IS
+	BEGIN
+		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;
+	END open_tab;
+
+	PROCEDURE open_tab2 (tabcursor IN OUT TabType,tablenames IN OUT VARCHAR) IS
+	BEGIN
+		OPEN tabcursor FOR SELECT * FROM TAB WHERE tname LIKE tablenames;
+		tablenames := 'TEST';
+	END open_tab2;
+
+PROCEDURE data_out(input IN VARCHAR, output OUT VARCHAR) IS
+	BEGIN
+		output := 'Cinta Hati '||input;
+	END;
+	
+PROCEDURE data_in(input IN VARCHAR) IS
+	ignore varchar(1000);
+	BEGIN
+		ignore := input;
+	END;
+
+PROCEDURE myproc (p1 IN NUMBER, p2 OUT NUMBER) AS
+BEGIN
+p2 := p1;
+END;
+END Adodb;
+/
+
+*/
+
+		print "<h4>Testing Cursor Variables</h4>";
+		$rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:zz,'A%'); END;",'zz');
+	
+		if ($rs && !$rs->EOF) {
+			$v = $db->GetOne("SELECT count(*) FROM tab where tname like 'A%'");
+			if ($v == $rs->RecordCount()) print "Test 1 RowCount: OK<p>";
+			else Err("Test 1 RowCount ".$rs->RecordCount().", actual = $v");
+		} else {
+			print "<b>Error in using Cursor Variables 1</b><p>";
+		}
+		$rs->Close();
+		
+		print "<h4>Testing Stored Procedures for oci8</h4>";
+		
+		$stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;");
+		$a1 = 'Malaysia';
+		//$a2 = ''; # a2 doesn't even need to be defined!
+		$db->InParameter($stmt,$a1,'a1');
+		$db->OutParameter($stmt,$a2,'a2');
+		$rs = $db->Execute($stmt);
+		if ($rs) {
+			if ($a2 !== 'Cinta Hati Malaysia') print "<b>Stored Procedure Error: a2 = $a2</b><p>";
+			else echo  "OK: a2=$a2<p>";
+		} else {
+			print "<b>Error in using Stored Procedure IN/Out Variables</b><p>";
+		}
+		
+		$tname = 'A%';
+		
+		$stmt = $db->PrepareSP('select * from tab where tname like :tablename');
+		$db->Parameter($stmt,$tname,'tablename');
+		$rs = $db->Execute($stmt);
+		rs2html($rs);
+		
+		$stmt = $db->PrepareSP("begin adodb.data_in(:a1); end;");
+		$db->InParameter($stmt,$a1,'a1');
+		$db->Execute($stmt);
+		
+		$db->debug = $saved;
+		break;
+	
+	default:
+		break;
+	}
+	$arr = array(
+		array(1,'Caroline','Miranda'),
+		array(2,'John','Lim'),
+		array(3,'Wai Hun','See')
+	);
+	$db->debug=1;
+	print "<p>Testing Bulk Insert of 3 rows</p>";
+
+	$sql = "insert into ADOXYZ (id,firstname,lastname) values (".$db->Param('0').",".$db->Param('1').",".$db->Param('2').")";
+	$db->StartTrans();
+	$db->Execute($sql,$arr);
+	$db->CompleteTrans();
+	$rs = $db->Execute('select * from ADOXYZ order by id');
+	if ($rs->RecordCount() != 3) Err("Bad bulk insert");
+	
+	rs2html($rs);
+	
+	$db->Execute('delete from ADOXYZ');
+		
+	print "<p>Inserting 50 rows</p>";
+
+	for ($i = 0; $i < 5; $i++) {	
+
+	$time = $db->DBDate(time());
+	if (empty($_GET['hide'])) $db->debug = true;
+	switch($db->databaseType){
+	case 'mssqlpo':
+	case 'mssql':
+		$sqlt = "CREATE TABLE mytable (
+  row1 INT  IDENTITY(1,1) NOT NULL,
+  row2 varchar(16),
+  PRIMARY KEY  (row1))";
+  		//$db->debug=1;
+  		if (!$db->Execute("delete from mytable")) 
+			$db->Execute($sqlt);
+			
+		$ok = $db->Execute("insert into mytable (row2) values ('test')");
+		$ins_id=$db->Insert_ID();
+		echo "Insert ID=";var_dump($ins_id);
+		if ($ins_id == 0) Err("Bad Insert_ID()");
+		$ins_id2 = $db->GetOne("select row1 from mytable");
+		if ($ins_id != $ins_id2) Err("Bad Insert_ID() 2");
+		
+		$arr = array(0=>'Caroline',1=>'Miranda');
+		$sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,?,?,$time)";
+		break;
+	case 'mysqli':
+	case 'mysqlt':
+	case 'mysql':
+		$sqlt = "CREATE TABLE `mytable` (
+  `row1` int(11) NOT NULL auto_increment,
+  `row2` varchar(16) NOT NULL default '',
+  PRIMARY KEY  (`row1`),
+  KEY `myindex` (`row1`,`row2`)
+) ";
+		if (!$db->Execute("delete from mytable")) 
+			$db->Execute($sqlt);
+			
+		$ok = $db->Execute("insert into mytable (row2) values ('test')");
+		$ins_id=$db->Insert_ID();
+		echo "Insert ID=";var_dump($ins_id);
+		if ($ins_id == 0) Err("Bad Insert_ID()");
+		$ins_id2 = $db->GetOne("select row1 from mytable");
+		if ($ins_id != $ins_id2) Err("Bad Insert_ID() 2");
+		
+	default:
+		$arr = array(0=>'Caroline',1=>'Miranda');
+		$sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,?,?,$time)";
+		break;
+	
+	case 'oci8':
+	case 'oci805':
+		$arr = array('first'=>'Caroline','last'=>'Miranda');
+		$amt = rand() % 100;
+		$sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,:first,:last,$time)";		
+		break;
+	}
+	if ($i & 1) {
+		$sql = $db->Prepare($sql);
+	}
+	$rs = $db->Execute($sql,$arr);
+		
+	if ($rs === false) Err( 'Error inserting with parameters');
+	else $rs->Close();
+	$db->debug = false;
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+1,'John','Lim',$time)");
+	/*$ins_id=$db->Insert_ID();
+	echo "Insert ID=";var_dump($ins_id);*/
+	if ($db->databaseType == 'mysql') if ($ins_id == 0) Err('Bad Insert_ID');
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+2,'Mary','Lamb',$time )");
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+3,'George','Washington',$time )");
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+4,'Mr. Alan','Tam',$time )");
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+5,'Alan',".$db->quote("Turing'ton").",$time )");
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created)values ($i*10+6,'Serena','Williams',$time )");
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+7,'Yat Sun','Sun',$time )");
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+8,'Wai Hun','See',$time )");
+	$db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+9,'Steven','Oey',$time )");
+	} // for
+	if (1) {
+	$db->debug=1;
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$cnt = $db->GetOne("select count(*) from ADOXYZ");
+	$rs = $db->Execute('update ADOXYZ set id=id+1');	
+	if (!is_object($rs)) {
+		print_r($rs);
+		err("Update should return object");
+	} 
+	if (!$rs) err("Update generated error");
+	
+	$nrows = $db->Affected_Rows();   
+	if ($nrows === false) print "<p><b>Affected_Rows() not supported</b></p>";
+	else if ($nrows != $cnt)  print "<p><b>Affected_Rows() Error: $nrows returned (should be 50) </b></p>";
+	else print "<p>Affected_Rows() passed</p>";
+	}
+	
+	/*if ($db->dataProvider == 'oci8') */ $array = array('zid'=>1,'zdate'=>date('Y-m-d',time()));
+	/*else $array=array(1,date('Y-m-d',time()));*/
+	
+	$id = $db->GetOne("select id from ADOXYZ 
+		where id=".$db->Param('zid')." and created>=".$db->Param('ZDATE')."",
+		$array);
+	if ($id != 1) Err("Bad bind; id=$id");
+	else echo "<br>Bind date/integer passed";
+	
+	$db->debug = false;
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+ //////////////////////////////////////////////////////////////////////////////////////////
+	
+	$rs = $db->Execute("select * from ADOXYZ where firstname = 'not known'");
+	if (!$rs ||  !$rs->EOF) print "<p><b>Error on empty recordset</b></p>";
+	else if ($rs->RecordCount() != 0) {
+		print "<p><b>Error on RecordCount. Should be 0. Was ".$rs->RecordCount()."</b></p>"; 
+		print_r($rs->fields);
+	}
+	if ($db->databaseType !== 'odbc') {
+		$rs = &$db->Execute("select id,firstname,lastname,created,".$db->random." from ADOXYZ order by id");
+		if ($rs) {
+			if ($rs->RecordCount() != 50) {
+				print "<p><b>RecordCount returns ".$rs->RecordCount()."</b></p>";
+				$poc = $rs->PO_RecordCount('ADOXYZ');
+				if ($poc == 50) print "<p> &nbsp; &nbsp; PO_RecordCount passed</p>";
+				else print "<p><b>PO_RecordCount returns wrong value: $poc</b></p>";
+			} else print "<p>RecordCount() passed</p>";
+			if (isset($rs->fields['firstname'])) print '<p>The fields columns can be indexed by column name.</p>';
+			else {
+				Err( '<p>The fields columns <i>cannot</i> be indexed by column name.</p>');
+				print_r($rs->fields);
+			}
+			if (empty($_GET['hide'])) rs2html($rs);
+		}
+		else print "<p><b>Error in Execute of SELECT with random</b></p>";
+	}
+	$val = $db->GetOne("select count(*) from ADOXYZ");
+	 if ($val == 50) print "<p>GetOne returns ok</p>";
+	 else print "<p><b>Fail: GetOne returns $val</b></p>";
+
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	$val = $db->GetRow("select count(*) from ADOXYZ");
+	 if ($val[0] == 50 and sizeof($val) == 1) print "<p>GetRow returns ok</p>";
+	 else {
+	 	print_r($val);
+	 	print "<p><b>Fail: GetRow returns {$val[0]}</b></p>";
+	}
+
+	print "<p>FetchObject/FetchNextObject Test</p>";
+	$rs = $db->Execute('select * from ADOXYZ');
+	if ($rs) {
+		if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
+		
+		while ($o = $rs->FetchNextObject()) { // calls FetchObject internally
+			if (!is_string($o->FIRSTNAME) || !is_string($o->LASTNAME)) {
+				print_r($o);
+				print "<p><b>Firstname is not string</b></p>";
+				break;
+			}
+		}
+	} else {
+		print "<p><b>Failed rs</b></p>";
+		die("<p>ADOXYZ table cannot be read - die()");
+	}
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	print "<p>FetchObject/FetchNextObject Test 2</p>";
+	$db->debug=99;
+	$rs = $db->Execute('select * from ADOXYZ');
+	if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
+	print_r($rs->fields);
+	while ($o = $rs->FetchNextObject()) { // calls FetchObject internally
+		if (!is_string($o->FIRSTNAME) || !is_string($o->LASTNAME)) {
+			print_r($o);
+			print "<p><b>Firstname is not string</b></p>";
+			break;
+		}
+	}
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	
+	$savefetch = $ADODB_FETCH_MODE;
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	
+	print "<p>CacheSelectLimit  Test</p>";
+	$db->debug=1;
+	$rs = $db->CacheSelectLimit('  select  id, firstname from  ADOXYZ order by id',2);
+	
+	if ($rs && !$rs->EOF) {
+		if (isset($rs->fields[0])) {
+			Err("ASSOC has numeric fields");
+			print_r($rs->fields);
+		}
+		if ($rs->fields['id'] != 1)  {Err("Error"); print_r($rs->fields);};
+		if (trim($rs->fields['firstname']) != 'Caroline')  {print Err("Error 2"); print_r($rs->fields);};
+		
+		$rs->MoveNext();
+		if ($rs->fields['id'] != 2)  {Err("Error 3"); print_r($rs->fields);};
+		$rs->MoveNext();
+		if (!$rs->EOF) {
+			Err("Error EOF");
+			print_r($rs);
+		}
+	}
+	
+	print "<p>FETCH_MODE = ASSOC: Should get 1, Caroline</p>";
+	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',2);
+	if ($rs && !$rs->EOF) {
+		if (ADODB_ASSOC_CASE == 2) {
+			$id = 'ID';
+			$fname = 'FIRSTNAME';
+		}else {
+			$id = 'id';
+			$fname = 'firstname';
+		}
+		if ($rs->fields[$id] != 1)  {Err("Error 1"); print_r($rs->fields);};
+		if (trim($rs->fields[$fname]) != 'Caroline')  {Err("Error 2"); print_r($rs->fields);};
+		$rs->MoveNext();
+		if ($rs->fields[$id] != 2)  {Err("Error 3"); print_r($rs->fields);};
+		$rs->MoveNext();
+		if (!$rs->EOF) Err("Error EOF");
+		else if (is_array($rs->fields) || $rs->fields) {
+			Err("Error: ## fields should be set to false on EOF");
+			print_r($rs->fields);
+		}
+	}
+	
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	print "<p>FETCH_MODE = NUM: Should get 1, Caroline</p>";
+	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',1);
+	if ($rs && !$rs->EOF) {
+		if (isset($rs->fields['id'])) Err("FETCH_NUM has ASSOC fields");
+		if ($rs->fields[0] != 1)  {Err("Error 1"); print_r($rs->fields);};
+		if (trim($rs->fields[1]) != 'Caroline')  {Err("Error 2");print_r($rs->fields);};
+		$rs->MoveNext();
+		if (!$rs->EOF) Err("Error EOF");
+
+	}
+	$ADODB_FETCH_MODE = $savefetch;
+	
+	$db->debug = false;
+	print "<p>GetRowAssoc Upper: Should get 1, Caroline</p>";
+	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',1);
+	if ($rs && !$rs->EOF) {
+		$arr = &$rs->GetRowAssoc();
+		if ($arr['ID'] != 1) {Err("Error 1");print_r($arr);};
+		if (trim($arr['FIRSTNAME']) != 'Caroline') {Err("Error 2"); print_r($arr);};
+		$rs->MoveNext();
+		if (!$rs->EOF) Err("Error EOF");
+
+	}
+	print "<p>GetRowAssoc Lower: Should get 1, Caroline</p>";
+	$rs = &$db->SelectLimit('select id,firstname from ADOXYZ order by id',1);
+	if ($rs && !$rs->EOF) {
+		$arr = &$rs->GetRowAssoc(false);
+		if ($arr['id'] != 1) {Err("Error 1"); print_r($arr);};
+		if (trim($arr['firstname']) != 'Caroline') {Err("Error 2"); print_r($arr);};
+
+	}
+	
+	print "<p>GetCol Test</p>";
+	$col = $db->GetCol('select distinct firstname from adoxyz order by 1');
+	if (!is_array($col)) Err("Col size is wrong");
+	if (trim($col[0]) != 'Alan' or trim($col[9]) != 'Yat Sun') Err("Col elements wrong");
+
+	$db->debug = true;
+	
+		
+	echo "<p>Date Update Test</p>";
+	$zdate = date('Y-m-d',time()+3600*24);
+	$zdate = $db->DBDate($zdate);
+	$db->Execute("update ADOXYZ set created=$zdate where id=1");
+	$row = $db->GetRow("select created,firstname from ADOXYZ where id=1");
+	print_r($row); echo "<br>";
+	
+	
+	
+	print "<p>SelectLimit Distinct Test 1: Should see Caroline, John and Mary</p>";
+	$rs = &$db->SelectLimit('select distinct * from ADOXYZ order by id',3);
+	
+	
+	if ($rs && !$rs->EOF) {
+		if (trim($rs->fields[1]) != 'Caroline') Err("Error 1 (exp Caroline), ".$rs->fields[1]);
+		$rs->MoveNext();
+		
+		if (trim($rs->fields[1]) != 'John') Err("Error 2 (exp John), ".$rs->fields[1]);
+		$rs->MoveNext();
+		if (trim($rs->fields[1]) != 'Mary') Err("Error 3 (exp Mary),".$rs->fields[1]);
+		$rs->MoveNext();
+		if (! $rs->EOF) Err("Error EOF");
+		//rs2html($rs);
+	} else Err("Failed SelectLimit Test 1");
+	
+	print "<p>SelectLimit Test 2: Should see Mary, George and Mr. Alan</p>";
+	$rs = &$db->SelectLimit('select * from ADOXYZ order by id',3,2);
+	if ($rs && !$rs->EOF) {
+		if (trim($rs->fields[1]) != 'Mary') Err("Error 1 - No Mary, instead: ".$rs->fields[1]);
+		$rs->MoveNext();
+		if (trim($rs->fields[1]) != 'George')Err("Error 2 - No George, instead: ".$rs->fields[1]);
+		$rs->MoveNext();
+		if (trim($rs->fields[1]) != 'Mr. Alan') Err("Error 3 - No Mr. Alan, instead: ".$rs->fields[1]);
+		$rs->MoveNext();
+		if (! $rs->EOF) Err("Error EOF");
+	//	rs2html($rs);
+	}
+	 else Err("Failed SelectLimit Test 2 ". ($rs ? 'EOF':'no RS'));
+	
+	print "<p>SelectLimit Test 3: Should see Wai Hun and Steven</p>";
+	$db->debug=1;
+	global $A; $A=1;
+	$rs = &$db->SelectLimit('select * from ADOXYZ order by id',-1,48);
+	$A=0;
+	if ($rs && !$rs->EOF) {
+		if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
+		if (trim($rs->fields[1]) != 'Wai Hun') Err("Error 1 ".$rs->fields[1]);
+		$rs->MoveNext();
+		if (trim($rs->fields[1]) != 'Steven') Err("Error 2 ".$rs->fields[1]);
+		$rs->MoveNext();
+		if (! $rs->EOF) {
+			Err("Error EOF");
+		}
+		//rs2html($rs);
+	}
+	 else Err("Failed SelectLimit Test 3");
+		$db->debug = false;
+	
+	
+	$rs = &$db->Execute("select * from ADOXYZ order by id");
+	print "<p>Testing Move()</p>";	
+	if (!$rs)Err( "Failed Move SELECT");
+	else {
+		if (!$rs->Move(2)) {
+			if (!$rs->canSeek) print "<p>$db->databaseType: <b>Move(), MoveFirst() nor MoveLast() not supported.</b></p>";
+			else print '<p><b>RecordSet->canSeek property should be set to false</b></p>';
+		} else {
+			$rs->MoveFirst();
+			if (trim($rs->Fields("firstname")) != 'Caroline') {
+				print "<p><b>$db->databaseType: MoveFirst failed -- probably cannot scroll backwards</b></p>";
+			}
+			else print "MoveFirst() OK<BR>";
+						
+						// Move(3) tests error handling -- MoveFirst should not move cursor
+			$rs->Move(3);
+			if (trim($rs->Fields("firstname")) != 'George') {
+				print '<p>'.$rs->Fields("id")."<b>$db->databaseType: Move(3) failed</b></p>";
+			} else print "Move(3) OK<BR>";
+						
+			$rs->Move(7);
+			if (trim($rs->Fields("firstname")) != 'Yat Sun') {
+				print '<p>'.$rs->Fields("id")."<b>$db->databaseType: Move(7) failed</b></p>";
+				print_r($rs);
+			} else print "Move(7) OK<BR>";
+			if ($rs->EOF) Err("Move(7) is EOF already");
+			$rs->MoveLast();
+			if (trim($rs->Fields("firstname")) != 'Steven'){
+				 print '<p>'.$rs->Fields("id")."<b>$db->databaseType: MoveLast() failed</b></p>";
+				 print_r($rs);
+			}else print "MoveLast() OK<BR>";
+			$rs->MoveNext();
+			if (!$rs->EOF) err("Bad MoveNext");
+			if ($rs->canSeek) {
+				$rs->Move(3);
+				if (trim($rs->Fields("firstname")) != 'George') {
+					print '<p>'.$rs->Fields("id")."<b>$db->databaseType: Move(3) after MoveLast failed</b></p>";
+					
+				} else print "Move(3) after MoveLast() OK<BR>";
+			}
+			
+			print "<p>Empty Move Test";
+			$rs = $db->Execute("select * from ADOXYZ where id > 0 and id < 0");
+			$rs->MoveFirst();
+			if (!$rs->EOF || $rs->fields) Err("Error in empty move first");
+		}
+	}
+	
+	$rs = $db->Execute('select * from ADOXYZ where id = 2');
+	if ($rs->EOF || !is_array($rs->fields)) Err("Error in select");
+	$rs->MoveNext();
+	if (!$rs->EOF) Err("Error in EOF (xx) ");
+ //	$db->debug=true;
+	print "<p>Testing ADODB_FETCH_ASSOC and concat: concat firstname and lastname</p>";
+
+	$save = $ADODB_FETCH_MODE;
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	if ($db->dataProvider == 'postgres') {
+		$sql = "select ".$db->Concat('cast(firstname as varchar)',$db->qstr(' '),'lastname')." as fullname,id,".$db->sysTimeStamp." as d from ADOXYZ";
+		$rs = &$db->Execute($sql);
+	} else {
+		$sql = "select distinct ".$db->Concat('firstname',$db->qstr(' '),'lastname')." as fullname,id,".$db->sysTimeStamp." as d from ADOXYZ";
+		$rs = &$db->Execute($sql);
+	}
+	if ($rs) {
+		if (empty($_GET['hide'])) rs2html($rs);
+	} else {
+		Err( "Failed Concat:".$sql);
+	}
+	$ADODB_FETCH_MODE = $save;
+	print "<hr>Testing GetArray() ";
+	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	
+	$rs = &$db->Execute("select * from ADOXYZ order by id");
+	if ($rs) {
+		$arr = &$rs->GetArray(10);
+		if (sizeof($arr) != 10 || trim($arr[1][1]) != 'John' || trim($arr[1][2]) != 'Lim') print $arr[1][1].' '.$arr[1][2]."<b> &nbsp; ERROR</b><br>";
+		else print " OK<BR>";
+	}
+	
+	$arr = $db->GetArray("select x from ADOXYZ");
+	$e = $db->ErrorMsg(); $e2 = $db->ErrorNo();
+	echo "Testing error handling, should see illegal column 'x' error=<i>$e ($e2) </i><br>";
+	if (!$e || !$e2) Err("Error handling did not work");
+	print "Testing FetchNextObject for 1 object ";
+	$rs = &$db->Execute("select distinct lastname,firstname from ADOXYZ where firstname='Caroline'");
+	$fcnt = 0;
+	if ($rs)
+	while ($o = $rs->FetchNextObject()) {
+		$fcnt += 1;	
+	}
+	if ($fcnt == 1) print " OK<BR>";
+	else print "<b>FAILED</b><BR>";
+	
+	$stmt = $db->Prepare("select * from ADOXYZ where id < 3");
+	$rs = $db->Execute($stmt);
+	if (!$rs) Err("Prepare failed");
+	else {
+		$arr = $rs->GetArray();
+		if (!$arr) Err("Prepare failed 2");
+		if (sizeof($arr) != 2) Err("Prepare failed 3");
+	}
+	print "Testing GetAssoc() ";
+	$savecrecs = $ADODB_COUNTRECS;
+	$ADODB_COUNTRECS = false;
+	//$arr = $db->GetArray("select  lastname,firstname from ADOXYZ");
+	//print_r($arr);
+	print "<hr>";
+	$rs =& $db->Execute("select distinct lastname,firstname,created from ADOXYZ");
+	
+	if ($rs) {
+		$arr = $rs->GetAssoc();
+		//print_r($arr);
+		if (empty($arr['See']) || trim(reset($arr['See'])) != 'Wai Hun') print $arr['See']." &nbsp; <b>ERROR</b><br>";
+		else print " OK 1";
+	}
+	
+	$arr = &$db->GetAssoc("select distinct lastname,firstname from ADOXYZ");
+	if ($arr) {
+		//print_r($arr);
+		if (empty($arr['See']) || trim($arr['See']) != 'Wai Hun') print $arr['See']." &nbsp; <b>ERROR</b><br>";
+		else print " OK 2<BR>";
+	}
+	// Comment this out to test countrecs = false
+	$ADODB_COUNTRECS = $savecrecs;
+	
+	for ($loop=0; $loop < 1; $loop++) {
+	print "Testing GetMenu() and CacheExecute<BR>";
+	$db->debug = true;
+	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
+	
+	if ($rs) print 'With blanks, Steven selected:'. $rs->GetMenu('menu','Steven').'<BR>'; 
+	else print " Fail<BR>";
+	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
+	
+	if ($rs) print ' No blanks, Steven selected: '. $rs->GetMenu('menu','Steven',false).'<BR>';
+	else print " Fail<BR>";
+	
+	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
+	if ($rs) print ' Multiple, Alan selected: '. $rs->GetMenu('menu','Alan',false,true).'<BR>';
+	else print " Fail<BR>";
+	print '</p><hr>';
+	
+	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
+	if ($rs) {
+		print ' Multiple, Alan and George selected: '. $rs->GetMenu('menu',array('Alan','George'),false,true);
+		if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
+	} else print " Fail<BR>";
+	print '</p><hr>';
+	
+	print "Testing GetMenu2() <BR>";
+	$rs = &$db->CacheExecute(4,"select distinct firstname,lastname from ADOXYZ");
+	if ($rs) print 'With blanks, Steven selected:'. $rs->GetMenu2('menu',('Oey')).'<BR>'; 
+	else print " Fail<BR>";
+	$rs = &$db->CacheExecute(6,"select distinct firstname,lastname from ADOXYZ");
+	if ($rs) print ' No blanks, Steven selected: '. $rs->GetMenu2('menu',('Oey'),false).'<BR>';
+	else print " Fail<BR>";
+	}
+	echo "<h3>CacheEXecute</h3>";
+
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	$rs = &$db->CacheExecute(6,"select distinct firstname,lastname from ADOXYZ");
+	print_r($rs->fields); echo $rs->fetchMode;echo "<br>";
+	echo $rs->Fields('firstname');
+	
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$rs = &$db->CacheExecute(6,"select distinct firstname,lastname from ADOXYZ");
+	print_r($rs->fields);echo "<br>";
+	echo $rs->Fields('firstname');
+	$db->debug = false;
+	
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	// phplens
+	
+	$sql = 'select * from ADOXYZ where 0=1';
+	echo "<p>**Testing '$sql' (phplens compat 1)</p>";
+	$rs = &$db->Execute($sql);
+	if (!$rs) err( "<b>No recordset returned for '$sql'</b>");
+	if (!$rs->FieldCount()) err( "<b>No fields returned for $sql</b>");
+	if (!$rs->FetchField(1)) err( "<b>FetchField failed for $sql</b>");
+	
+	$sql = 'select * from ADOXYZ order by 1';
+	echo "<p>**Testing '$sql' (phplens compat 2)</p>";
+	$rs = &$db->Execute($sql);
+	if (!$rs) err( "<b>No recordset returned for '$sql'<br>".$db->ErrorMsg()."</b>");
+	
+	
+	$sql = 'select * from ADOXYZ order by 1,1';
+	echo "<p>**Testing '$sql' (phplens compat 3)</p>";
+	$rs = &$db->Execute($sql);
+	if (!$rs) err( "<b>No recordset returned for '$sql'<br>".$db->ErrorMsg()."</b>");
+	
+	
+	// Move
+	$rs1 = &$db->Execute("select id from ADOXYZ where id <= 2 order by 1");
+	$rs2 = &$db->Execute("select id from ADOXYZ where id = 3 or id = 4 order by 1");
+
+	if ($rs1) $rs1->MoveLast();
+	if ($rs2) $rs2->MoveLast();
+	
+	if (empty($rs1) || empty($rs2) || $rs1->fields[0] != 2 || $rs2->fields[0] != 4) {
+		$a = $rs1->fields[0];
+		$b = $rs2->fields[0];
+		print "<p><b>Error in multiple recordset test rs1=$a rs2=$b (should be rs1=2 rs2=4)</b></p>";
+	} else
+		print "<p>Testing multiple recordsets OK</p>";
+		
+	
+	echo "<p> GenID test: ";
+	for ($i=1; $i <= 10; $i++) 
+		echo  "($i: ",$val = $db->GenID($db->databaseType.'abcseq6' ,5), ") ";
+	if ($val == 0) Err("GenID not supported");
+	
+	if ($val) {
+		$db->DropSequence('abc_seq2');
+		$db->CreateSequence('abc_seq2');
+		$val = $db->GenID('abc_seq2');
+		$db->DropSequence('abc_seq2');
+		$db->CreateSequence('abc_seq2');
+		$val = $db->GenID('abc_seq2');
+		if ($val != 1) Err("Drop and Create Sequence not supported ($val)");
+	}
+	echo "<p>";
+	
+	if (substr($db->dataProvider,0,3) != 'notused') { // used to crash ado
+		$sql = "select firstnames from adoxyz";
+		print "<p>Testing execution of illegal statement: <i>$sql</i></p>";
+		if ($db->Execute($sql) === false) {
+			print "<p>This returns the following ErrorMsg(): <i>".$db->ErrorMsg()."</i> and ErrorNo(): ".$db->ErrorNo().'</p>';
+		} else 
+			print "<p><b>Error in error handling -- Execute() should return false</b></p>";
+	} else 
+		print "<p><b>ADO skipped error handling of bad select statement</b></p>";
+	
+	print "<p>ASSOC TEST 2<br>";
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$rs = $db->query('select * from adoxyz order by id');
+	if ($ee = $db->ErrorMsg()) {
+		Err("Error message=$ee");
+	}
+	if ($ee = $db->ErrorNo()) {
+		Err("Error No = $ee");
+	}
+	print_r($rs->fields);
+	for($i=0;$i<$rs->FieldCount();$i++) 
+	{ 
+		$fld=$rs->FetchField($i); 
+		print "<br> Field name is ".$fld->name; 
+		print " ".$rs->Fields($fld->name); 
+	} 
+
+		
+	print "<p>BOTH TEST 2<br>";
+	if ($db->dataProvider == 'ado') {
+		print "<b>ADODB_FETCH_BOTH not supported</b> for dataProvider=".$db->dataProvider."<br>";
+	} else {
+		$ADODB_FETCH_MODE = ADODB_FETCH_BOTH;
+		$rs = $db->query('select * from adoxyz order by id');
+		for($i=0;$i<$rs->FieldCount();$i++) 
+		{ 
+			$fld=$rs->FetchField($i); 
+			print "<br> Field name is ".$fld->name; 
+			print " ".$rs->Fields($fld->name); 
+		} 
+	}
+	
+	print "<p>NUM TEST 2<br>";
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	$rs = $db->query('select * from adoxyz order by id');
+	for($i=0;$i<$rs->FieldCount();$i++) 
+	{ 
+		$fld=$rs->FetchField($i); 
+		print "<br> Field name is ".$fld->name; 
+		print " ".$rs->Fields($fld->name); 
+	} 
+	
+	print "<p>ASSOC Test of SelectLimit<br>";
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$rs = $db->selectlimit('select * from adoxyz order by id',3,4);
+	$cnt = 0;
+	while ($rs && !$rs->EOF) {
+		$cnt += 1;
+		if (!isset($rs->fields['firstname'])) {
+			print "<br><b>ASSOC returned numeric field</b></p>";
+			break;
+		}
+		$rs->MoveNext();
+	}
+	if ($cnt != 3) print "<br><b>Count should be 3, instead it was $cnt</b></p>";
+	
+	
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	if ($db->sysDate) {
+		$saved = $db->debug;
+		$db->debug = 1;
+		$rs = $db->Execute("select {$db->sysDate} from adoxyz where id=1");
+		if (ADORecordSet::UnixDate(date('Y-m-d')) != $rs->UnixDate($rs->fields[0])) {
+			print "<p><b>Invalid date {$rs->fields[0]}</b></p>";
+		} else
+			print "<p>Passed \$sysDate test ({$rs->fields[0]})</p>";
+		
+		print_r($rs->FetchField(0));
+		print time();
+		$db->debug=$saved;
+	} else {
+		print "<p><b>\$db->sysDate not defined</b></p>";
+	}
+
+	print "<p>Test CSV</p>";
+	include_once('../toexport.inc.php');
+	//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$rs = $db->SelectLimit('select id,firstname,lastname,created,\'He, he\' he,\'"\' q  from adoxyz',10);	
+	
+	print "<pre>";
+	print rs2csv($rs);
+	print "</pre>";
+	
+	$rs = $db->SelectLimit('select id,firstname,lastname,created,\'The	"young man", he said\' from adoxyz',10);	
+	
+	if (PHP_VERSION < 5) {
+		print "<pre>";
+		rs2tabout($rs);
+		print "</pre>";
+	}
+	//print " CacheFlush ";
+	//$db->CacheFlush();
+	$date = $db->SQLDate('d-m-M-Y-\QQ h:i:s A');
+	$sql = "SELECT $date from ADOXYZ";
+	print "<p>Test SQLDate: ".htmlspecialchars($sql)."</p>";
+	$rs = $db->SelectLimit($sql,1);
+	$d = date('d-m-M-Y-').'Q'.(ceil(date('m')/3.0)).date(' h:i:s A');
+	if (!$rs) Err("SQLDate query returned no recordset");
+	else if ($d != $rs->fields[0]) Err("SQLDate 1 failed expected: <br>act:$d <br>sql:".$rs->fields[0]);
+	
+	$date = $db->SQLDate('d-m-M-Y-\QQ h:i:s A',$db->DBDate("1974-02-25"));
+	$sql = "SELECT $date from ADOXYZ";
+	print "<p>Test SQLDate: ".htmlspecialchars($sql)."</p>";
+	$rs = $db->SelectLimit($sql,1);
+	$ts = ADOConnection::UnixDate('1974-02-25');
+	$d = date('d-m-M-Y-',$ts).'Q'.(ceil(date('m',$ts)/3.0)).date(' h:i:s A',$ts);
+	if (!$rs) {
+		Err("SQLDate query returned no recordset");
+		echo $db->ErrorMsg(),'<br>';
+	} else if ($d != $rs->fields[0]) Err("SQLDate 2 failed expected: <br>act:$d <br>sql:".$rs->fields[0]);
+	
+	
+	print "<p>Test Filter</p>";
+	$db->debug = 1;
+	
+	$rs = $db->SelectLimit('select * from ADOXYZ where id < 3 order by id');
+	
+	$rs = RSFilter($rs,'do_strtolower');
+	if (trim($rs->fields[1]) != 'caroline'  && trim($rs->fields[2]) != 'miranda') {
+		err('**** RSFilter failed');
+		print_r($rs->fields);
+	}
+	
+	rs2html($rs);
+		
+	$db->debug=1;
+	
+	
+	print "<p>Test Replace</p>";
+	
+	$ret = $db->Replace('adoxyz', 
+		array('id'=>1,'firstname'=>'Caroline','lastname'=>'Miranda'),
+		array('id'),
+		$autoq = true);
+	if (!$ret) echo "<p>Error in replacing existing record</p>";
+	else {
+		$saved = $db->debug;
+		$db->debug = 0;
+		$savec = $ADODB_COUNTRECS;
+		$ADODB_COUNTRECS = true;
+		$rs = $db->Execute('select * FROM ADOXYZ where id=1');
+		$db->debug = $saved;
+		if ($rs->RecordCount() != 1) {
+			$cnt = $rs->RecordCount();
+			rs2html($rs);
+			print "<b>Error - Replace failed, count=$cnt</b><p>";
+		}
+		$ADODB_COUNTRECS = $savec;
+	}
+	$ret = $db->Replace('adoxyz', 
+		array('id'=>1000,'firstname'=>'Harun','lastname'=>'Al-Rashid'),
+		array('id','firstname'),
+		$autoq = true);
+	if ($ret != 2) print "<b>Replace failed: </b>";
+	print "test A return value=$ret (2 expected) <p>";
+	
+	$ret = $db->Replace('adoxyz', 
+		array('id'=>1000,'firstname'=>'Sherazade','lastname'=>'Al-Rashid'),
+		'id',
+		$autoq = true);
+	if ($ret != 1) 
+		if ($db->dataProvider == 'ibase' && $ret == 2);
+		else print "<b>Replace failed: </b>";
+	print "test B return value=$ret (1 or if ibase then 2 expected) <p>";
+	
+	print "<h3>rs2rs Test</h3>";
+	
+	$rs = $db->Execute('select * from adoxyz where id>= 1 order by id');
+	$rs = $db->_rs2rs($rs);
+	$rs->valueX = 'X';
+	$rs->MoveNext();
+	$rs = $db->_rs2rs($rs);
+	if (!isset($rs->valueX)) err("rs2rs does not preserve array recordsets");
+	if (reset($rs->fields) != 1) err("rs2rs does not move to first row: id=".reset($rs->fields));
+
+	/////////////////////////////////////////////////////////////
+	include_once('../pivottable.inc.php');
+	print "<h3>Pivot Test</h3>";
+	$db->debug=true;
+ 	$sql = PivotTableSQL(
+ 		$db,  			# adodb connection
+ 		'adoxyz',  		# tables
+		'firstname',	# row fields
+		'lastname',		# column fields 
+		false,			# join
+		'ID', 			# sum
+		'Sum ',			# label for sum
+		'sum',			# aggregate function
+		true
+	);
+	$rs = $db->Execute($sql);
+	if ($rs) rs2html($rs);
+	else Err("Pivot sql error");
+	
+	$db->debug=false;
+	include_once "PEAR.php";
+	
+	// PEAR TESTS BELOW
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
+	$pear = true;
+	$rs = $db->query('select * from adoxyz where id>0 and id<10 order by id');
+	
+	$i = 0;
+	if ($rs && !$rs->EOF) {
+		while ($arr = $rs->fetchRow()) {
+			$i++;
+			//print "$i ";
+			if ($arr[0] != $i) {
+				print_r($arr);
+				print "<p><b>PEAR DB emulation error 1.</b></p>";
+				$pear = false;
+				break;
+			}
+		}
+		$rs->Close();
+	}
+	
+	
+	if ($i != $db->GetOne('select count(*) from adoxyz where id>0 and id<10')) {
+		print "<p><b>PEAR DB emulation error 1.1 EOF ($i)</b></p>";
+		$pear = false;
+	}
+	
+	$rs = $db->limitQuery('select * from adoxyz where id>0 order by id',$i=3,$top=3);
+	$i2 = $i;
+	if ($rs && !$rs->EOF) {
+
+		while (!is_object($rs->fetchInto($arr))) {
+			$i2++;
+			
+	//			print_r($arr);
+	//		print "$i ";print_r($arr);
+			if ($arr[0] != $i2) {
+				print "<p><b>PEAR DB emulation error 2.</b></p>";
+				$pear = false;
+				break;
+			}
+		}
+		$rs->Close();
+	}
+	if ($i2 != $i+$top) {
+		print "<p><b>PEAR DB emulation error 2.1 EOF (correct=$i+$top, actual=$i2)</b></p>";
+		$pear = false;
+	}
+	
+	if ($pear) print "<p>PEAR DB emulation passed.</p>";
+	
+	$rs = $db->SelectLimit("select ".$db->sysDate." from adoxyz",1);
+	$date = $rs->fields[0];
+	if (!$date) Err("Bad sysDate");
+	else {
+		$ds = $db->UserDate($date,"d m Y");
+		if ($ds != date("d m Y")) Err("Bad UserDate: ".$ds.' expected='.date("d m Y"));
+		else echo "Passed UserDate: $ds<p>";
+	}
+	$db->debug=1;
+	if ($db->dataProvider == 'oci8') 
+		$rs = $db->SelectLimit("select to_char(".$db->sysTimeStamp.",'YYYY-MM-DD HH24:MI:SS') from adoxyz",1);
+	else 
+		$rs = $db->SelectLimit("select ".$db->sysTimeStamp." from adoxyz",1);
+	$date = $rs->fields[0];
+	if (!$date) Err("Bad sysTimeStamp");
+	else {
+		$ds = $db->UserTimeStamp($date,"H \\h\\r\\s-d m Y");
+		if ($ds != date("H \\h\\r\\s-d m Y")) Err("Bad UserTimeStamp: ".$ds.", correct is ".date("H \\h\\r\\s-d m Y"));
+		else echo "Passed UserTimeStamp: $ds<p>";
+		
+		$date = 100;
+		$ds = $db->UserTimeStamp($date,"H \\h\\r\\s-d m Y");
+		$ds2 = date("H \\h\\r\\s-d m Y",$date);
+		if ($ds != $ds2) Err("Bad UserTimeStamp 2: $ds: $ds2");
+		else echo "Passed UserTimeStamp 2: $ds<p>";
+	}
+	if ($db->hasTransactions) {
+		//$db->debug=1;
+		echo "<p>Testing StartTrans CompleteTrans</p>";
+		$db->raiseErrorFn = false;
+		$db->StartTrans();
+		$rs = $db->Execute('select * from notable');
+			$db->StartTrans();
+				$db->BeginTrans();
+			$db->Execute("update ADOXYZ set firstname='Carolx' where id=1");
+				$db->CommitTrans();
+			$db->CompleteTrans();
+		$rez = $db->CompleteTrans();
+		if ($rez !== false) {
+			if (is_null($rez)) Err("Error: _transOK not modified");
+			else Err("Error: CompleteTrans (1) should have failed");
+		} else {
+			$name = $db->GetOne("Select firstname from ADOXYZ where id=1");
+			if ($name == "Carolx") Err("Error: CompleteTrans (2) should have failed");
+			else echo "<p> -- Passed StartTrans test1 - rolling back</p>";
+		}
+		
+		$db->StartTrans();
+			$db->BeginTrans();
+		$db->Execute("update ADOXYZ set firstname='Carolx' where id=1");
+			$db->RollbackTrans();
+		$rez = $db->CompleteTrans();
+		if ($rez !== true) Err("Error: CompleteTrans (1) should have succeeded");
+		else {
+			$name = $db->GetOne("Select firstname from ADOXYZ where id=1");
+			if (trim($name) != "Carolx") Err("Error: CompleteTrans (2) should have succeeded, returned name=$name");
+			else echo "<p> -- Passed StartTrans test2 - commiting</p>";
+		}
+	}
+	
+	$saved = $db->debug;
+	$db->debug=1;
+	$cnt = _adodb_getcount($db, 'select * from ADOXYZ where firstname in (select firstname from ADOXYZ)');
+	echo "<b>Count=</b> $cnt";
+	$db->debug=$saved;
+	
+	global $TESTERRS;
+	$debugerr = true;
+	
+	global $ADODB_LANG;$ADODB_LANG = 'fr';
+	$db->debug = false;
+	$TESTERRS = 0;
+	$db->raiseErrorFn = 'adodb_test_err';
+	global $ERRNO; // from adodb_test_err
+	$db->Execute('select * from nowhere');
+	$metae = $db->MetaError($ERRNO);
+	if ($metae !== DB_ERROR_NOSUCHTABLE) print "<p><b>MetaError=".$metae." wrong</b>, should be ".DB_ERROR_NOSUCHTABLE."</p>";
+	else print "<p>MetaError ok (".DB_ERROR_NOSUCHTABLE."): ".$db->MetaErrorMsg($metae)."</p>";
+	if ($TESTERRS != 1) print "<b>raiseErrorFn select nowhere failed</b><br>";
+	$rs = $db->Execute('select * from adoxyz');
+	if ($debugerr) print " Move";
+	$rs->Move(100);
+	$rs->_queryID = false;
+	if ($debugerr) print " MoveNext";
+	$rs->MoveNext();
+	if ($debugerr) print " $rs=false";
+	$rs = false;
+
+	print "<p>SetFetchMode() tests</p>";
+	$db->SetFetchMode(ADODB_FETCH_ASSOC);
+	$rs = $db->SelectLimit('select firstname from adoxyz',1);
+	if (!isset($rs->fields['firstname'])) Err("BAD FETCH ASSOC");
+	
+	$ADODB_FETCH_MODE = ADODB_FETCH_NUM;	
+	$rs = $db->SelectLimit('select firstname from adoxyz',1);
+	//var_dump($rs->fields);
+	if (!isset($rs->fields['firstname'])) Err("BAD FETCH ASSOC");
+	
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;	
+	$db->SetFetchMode(ADODB_FETCH_NUM);
+	$rs = $db->SelectLimit('select firstname from adoxyz',1);
+	if (!isset($rs->fields[0])) Err("BAD FETCH NUM");
+	
+	print "<p>Test MetaTables again with SetFetchMode()</p>";
+	$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+	$db->SetFetchMode(ADODB_FETCH_ASSOC);
+	print_r($db->MetaTables());
+	print "<p>";
+	////////////////////////////////////////////////////////////////////
+	
+	if ($db->dataProvider == 'odbtp') $db->databaseType = 'odbtp';
+	$conn = NewADOConnection($db->databaseType);
+	$conn->raiseErrorFn = 'adodb_test_err';
+	@$conn->PConnect('abc');
+	if ($TESTERRS == 2) print "raiseErrorFn tests passed<br>";
+	else print "<b>raiseErrorFn tests failed ($TESTERRS)</b><br>";
+	
+	
+	////////////////////////////////////////////////////////////////////
+	
+	global $nocountrecs;
+	
+	if (isset($nocountrecs) && $ADODB_COUNTRECS) err("Error: \$ADODB_COUNTRECS is set");
+	if (empty($nocountrecs) && $ADODB_COUNTRECS==false) err("Error: \$ADODB_COUNTRECS is not set");
+
+	
+?>
+	</p>
+	<table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
+	</p></form>
+<?php
+
+	if ($rs1) $rs1->Close();
+	if ($rs2) $rs2->Close();
+	if ($rs) $rs->Close();
+	$db->Close();
+	
+	if ($db->transCnt != 0) Err("Error in transCnt=$db->transCnt (should be 0)");
+	
+	
+	printf("<p>Total queries=%d; total cached=%d</p>",$EXECS+$CACHED, $CACHED);
+}
+
+function adodb_test_err($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
+{
+global $TESTERRS,$ERRNO;
+
+	$ERRNO = $errno;
+	$TESTERRS += 1;
+	print "<i>** $dbms ($fn): errno=$errno &nbsp; errmsg=$errmsg ($p1,$p2)</i><br>";
+}
+
+//--------------------------------------------------------------------------------------
+
+
+ at set_time_limit(240); // increase timeout
+
+include("../tohtml.inc.php");
+include("../adodb.inc.php");
+include("../rsfilter.inc.php");
+
+/* White Space Check */
+
+if (isset($_SERVER['argv'][1])) {
+	//print_r($_SERVER['argv']);
+	$_GET[$_SERVER['argv'][1]] = 1;
+}
+
+if (@$_SERVER['COMPUTERNAME'] == 'TIGRESS') {
+	CheckWS('mysqlt');
+	CheckWS('postgres');
+	CheckWS('oci8po');
+	
+	CheckWS('firebird');
+	CheckWS('sybase');
+	if (!ini_get('safe_mode')) CheckWS('informix');
+
+	CheckWS('ado_mssql');
+	CheckWS('ado_access');
+	CheckWS('mssql');
+	
+	CheckWS('vfp');
+	CheckWS('sqlanywhere');
+	CheckWS('db2');
+	CheckWS('access');
+	CheckWS('odbc_mssql');
+	CheckWS('firebird15');
+	//
+	CheckWS('oracle');
+	CheckWS('proxy');
+	CheckWS('fbsql');
+	print "White Space Check complete<p>";
+}
+if (sizeof($_GET) == 0) $testmysql = true;
+
+
+foreach($_GET as $k=>$v)  {
+	//global $$k;
+	$$k = $v;
+}	
+if (strpos(PHP_VERSION,'5') === 0) {
+	//$testaccess=1;
+	//$testmssql = 1;
+	//$testsqlite=1;
+}
+?>
+<html>
+<title>ADODB Testing</title>
+<body bgcolor=white>
+<H1>ADODB Test</H1>
+
+This script tests the following databases: Interbase, Oracle, Visual FoxPro, Microsoft Access (ODBC and ADO), MySQL, MSSQL (ODBC, native, ADO). 
+There is also support for Sybase, PostgreSQL.</p>
+For the latest version of ADODB, visit <a href=http://adodb.sourceforge.net/>adodb.sourceforge.net</a>.</p>
+
+Test <a href=test4.php>GetInsertSQL/GetUpdateSQL</a> &nbsp; 
+	<a href=testsessions.php>Sessions</a> &nbsp;
+	<a href=testpaging.php>Paging</a> &nbsp;
+	<a href=test-perf.php>Perf Monitor</a><p>
+<?php
+include('./testdatabases.inc.php');
+
+echo "<br>vers=",ADOConnection::Version();
+
+
+include_once('../adodb-time.inc.php');
+if (isset($_GET['time'])) adodb_date_test();
+
+?>
+<p><i>ADODB Database Library  (c) 2000-2005 John Lim. All rights reserved. Released under BSD and LGPL, PHP <?php echo PHP_VERSION ?>.</i></p>
+</body>
+</html>

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test2.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test2.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test2.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,26 @@
+<?php
+
+// BASIC ADO test
+
+	include_once('../adodb.inc.php');
+
+	$db = &ADONewConnection("ado_access");
+	$db->debug=1;
+	$access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
+	$myDSN =  'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
+		. 'DATA SOURCE=' . $access . ';';
+		
+	echo "<p>PHP ",PHP_VERSION,"</p>";
+	
+	$db->Connect($myDSN) || die('fail');
+	
+	print_r($db->ServerInfo());
+	
+	try {
+	$rs = $db->Execute("select $db->sysTimeStamp,* from adoxyz where id>02xx");
+	print_r($rs->fields);
+	} catch(exception $e) {
+	print_r($e);
+	echo "<p> Date m/d/Y =",$db->UserDate($rs->fields[4],'m/d/Y');
+	}
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test3.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test3.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test3.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,44 @@
+<?php
+/*
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
+  Set tabs to 8.
+ */
+
+
+error_reporting(E_ALL);
+
+$path = dirname(__FILE__);
+
+include("$path/../adodb-exceptions.inc.php");
+include("$path/../adodb.inc.php");	
+
+try {
+$db = NewADOConnection("oci8");
+$db->Connect('','scott','natsoft');
+$db->debug=1;
+
+$cnt = $db->GetOne("select count(*) from adoxyz");
+$rs = $db->Execute("select * from adoxyz order by id");
+
+$i = 0;
+foreach($rs as $k => $v) {
+	$i += 1;
+	echo $k; adodb_pr($v);
+	flush();
+}
+
+if ($i != $cnt) die("actual cnt is $i, cnt should be $cnt\n");
+
+
+
+$rs = $db->Execute("select bad from badder");
+
+} catch (exception $e) {
+	adodb_pr($e);
+	$e = adodb_backtrace($e->trace);
+}
+
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test4.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test4.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test4.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,134 @@
+<?php
+
+/** 
+ * @version V4.50 6 July 2004 (c) 2000-2005 John Lim (jlim at 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. 
+ *
+ * Set tabs to 4 for best viewing.
+ * 
+ * Latest version is available at http://php.weblogs.com
+ *
+ * Test GetUpdateSQL and GetInsertSQL.
+ */
+ 
+error_reporting(E_ALL);
+function testsql()
+{
+
+
+include('../adodb.inc.php');
+include('../tohtml.inc.php');
+
+global $ADODB_FORCE_TYPE;
+
+
+//==========================
+// This code tests an insert
+
+$sql = "
+SELECT * 
+FROM ADOXYZ WHERE id = -1"; 
+// Select an empty record from the database 
+
+
+#$conn = &ADONewConnection("mssql");  // create a connection
+#$conn->PConnect("", "sa", "natsoft", "northwind"); // connect to MySQL, testdb
+
+$conn = &ADONewConnection("mysql");  // create a connection
+$conn->PConnect("localhost", "root", "", "test"); // connect to MySQL, testdb
+
+//$conn =& ADONewConnection('oci8');
+//$conn->Connect('','scott','natsoft');
+//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
+
+$conn->debug=1;
+$conn->Execute("delete from adoxyz where lastname like 'Smi%'");
+
+$rs = $conn->Execute($sql); // Execute the query and get the empty recordset
+$record = array(); // Initialize an array to hold the record data to insert
+
+if (strpos($conn->databaseType,'mssql')!==false) $record['id'] = 751;
+$record["firstname"] = 'Jann';
+$record["lastname"] = "Smitts";
+$record["created"] = time();
+
+$insertSQL = $conn->GetInsertSQL($rs, $record);
+$conn->Execute($insertSQL); // Insert the record into the database
+
+if (strpos($conn->databaseType,'mssql')!==false) $record['id'] = 752;
+// Set the values for the fields in the record
+$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
+// into the GetInsertSQL function. The function will process the data and return
+// a fully formatted insert sql statement.
+$insertSQL = $conn->GetInsertSQL($rs, $record);
+$conn->Execute($insertSQL); // Insert the record into the database
+
+
+
+$insertSQL2 = $conn->GetInsertSQL($table='ADOXYZ', $record);
+if ($insertSQL != $insertSQL2) echo "<p><b>Walt's new stuff failed</b>: $insertSQL2</p>";
+//==========================
+// This code tests an update
+
+$sql = "
+SELECT * 
+FROM ADOXYZ WHERE lastname=".$conn->Param('var'). " ORDER BY 1"; 
+// Select a record to update 
+
+$varr = array('var'=>$record['lastname'].'');
+$rs = $conn->Execute($sql,$varr); // Execute the query and get the existing record to update
+if (!$rs || $rs->EOF) 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"] = ""; // Update Caroline's lastname from Miranda to Smith
+$record["creAted"] = '2002-12-'.(rand()%30+1);
+$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,$varr); // Update the record in the database
+if ($conn->Affected_Rows() != 1)print "<p><b>Error1 </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,$varr); // Update the record in the database
+if ($conn->Affected_Rows() != 1)print "<p><b>Error 2</b>: Rows Affected=".$conn->Affected_Rows().", should be 1</p>";
+
+$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
+//adodb_pr($rs);
+rs2html($rs);
+
+$record["firstName"] = "Carol-new-".rand();
+$record["lasTname"] = "Smithy"; // Update Caroline's lastname from Miranda to Smith
+$record["creAted"] = '2002-12-'.(rand()%30+1);
+$record['num'] = 331;
+
+$conn->AutoExecute('ADOXYZ',$record,'UPDATE', "lastname like 'Sm%'");
+$rs = $conn->Execute("select * from ADOXYZ where lastname like 'Sm%'");
+//adodb_pr($rs);
+rs2html($rs);
+}
+
+
+testsql();
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test5.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test5.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test5.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,47 @@
+<?php
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+
+
+// Select an empty record from the database 
+
+include('../adodb.inc.php');
+include('../tohtml.inc.php');
+
+include('../adodb-errorpear.inc.php');
+
+if (0) {
+	$conn = &ADONewConnection('mysql');
+	$conn->debug=1;
+	$conn->PConnect("localhost","root","","xphplens");
+	print $conn->databaseType.':'.$conn->GenID().'<br>';
+}
+
+if (0) {
+	$conn = &ADONewConnection("oci8");  // create a connection
+	$conn->debug=1;
+	$conn->PConnect("falcon", "scott", "tiger", "juris8.ecosystem.natsoft.com.my"); // connect to MySQL, testdb
+	print $conn->databaseType.':'.$conn->GenID();
+}
+
+if (0) {
+	$conn = &ADONewConnection("ibase");  // create a connection
+	$conn->debug=1;
+	$conn->Connect("localhost:c:\\Interbase\\Examples\\Database\\employee.gdb", "sysdba", "masterkey", ""); // connect to MySQL, testdb
+	print $conn->databaseType.':'.$conn->GenID().'<br>';
+}
+
+if (0) {
+	$conn = &ADONewConnection('postgres');
+	$conn->debug=1;
+	@$conn->PConnect("susetikus","tester","test","test");
+	print $conn->databaseType.':'.$conn->GenID().'<br>';
+}
+?>

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/test_rs_array.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/test_rs_array.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/test_rs_array.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,47 @@
+<?php
+
+include_once('../adodb.inc.php');
+$rs = new ADORecordSet_array();
+
+$array = array(
+array ('Name', 'Age'),
+array ('John', '12'),
+array ('Jill', '8'),
+array ('Bill', '49')
+);
+
+$typearr = array('C','I');
+
+
+$rs->InitArray($array,$typearr);
+
+while (!$rs->EOF) {
+	print_r($rs->fields);echo "<br>";
+	$rs->MoveNext();
+}
+
+echo "<hr> 1 Seek<br>";
+$rs->Move(1);
+while (!$rs->EOF) {
+	print_r($rs->fields);echo "<br>";
+	$rs->MoveNext();
+}
+
+echo "<hr> 2 Seek<br>";
+$rs->Move(2);
+while (!$rs->EOF) {
+	print_r($rs->fields);echo "<br>";
+	$rs->MoveNext();
+}
+
+echo "<hr> 3 Seek<br>";
+$rs->Move(3);
+while (!$rs->EOF) {
+	print_r($rs->fields);echo "<br>";
+	$rs->MoveNext();
+}
+
+
+
+die();
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testcache.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testcache.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testcache.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,29 @@
+<html>
+<body>
+<?php
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+
+$ADODB_CACHE_DIR = dirname(tempnam('/tmp',''));
+include("../adodb.inc.php");
+
+if (isset($access)) {
+	$db=ADONewConnection('access');
+	$db->PConnect('nwind');
+} else {
+	$db = ADONewConnection('mysql');
+	$db->PConnect('mangrove','root','','xphplens');
+}
+if (isset($cache)) $rs = $db->CacheExecute(120,'select * from products');
+else $rs = $db->Execute('select * from products');
+
+$arr = $rs->GetArray();
+print sizeof($arr);
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testdatabases.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testdatabases.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testdatabases.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,400 @@
+<?php
+  
+/*
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.
+*/ 
+ 
+ /* this file is used by the ADODB test program: test.php */
+ ?>
+
+<table><tr valign=top><td>
+<form method=get>
+<input type=checkbox name="testaccess" value=1 <?php echo !empty($testaccess) ? 'checked' : '' ?>> <b>Access</b><br>
+<input type=checkbox name="testibase" value=1 <?php echo !empty($testibase) ? 'checked' : '' ?>> <b>Interbase</b><br>
+<input type=checkbox name="testmssql" value=1 <?php echo !empty($testmssql) ? 'checked' : '' ?>> <b>MSSQL</b><br>
+ <input type=checkbox name="testmysql" value=1 <?php echo !empty($testmysql) ? 'checked' : '' ?>> <b>MySQL</b><br>
+<input type=checkbox name="testmysqlodbc" value=1 <?php echo !empty($testmysqlodbc) ? 'checked' : '' ?>> <b>MySQL ODBC</b><br>
+<input type=checkbox name="testmysqli" value=1 <?php echo !empty($testmysqli) ? 'checked' : '' ?>> <b>MySQLi</b>
+<br>
+<td><input type=checkbox name="testsqlite" value=1 <?php echo !empty($testsqlite) ? 'checked' : '' ?>> <b>SQLite</b><br>
+<input type=checkbox name="testproxy" value=1 <?php echo !empty($testproxy) ? 'checked' : '' ?>> <b>MySQL Proxy</b><br>
+<input type=checkbox name="testoracle" value=1 <?php echo !empty($testoracle) ? 'checked' : '' ?>> <b>Oracle (oci8)</b> <br>
+<input type=checkbox name="testpostgres" value=1 <?php echo !empty($testpostgres) ? 'checked' : '' ?>> <b>PostgreSQL</b><br>
+<input type=checkbox name="testpgodbc" value=1 <?php echo !empty($testpgodbc) ? 'checked' : '' ?>> <b>PostgreSQL ODBC</b><br>
+<td>
+<input type=checkbox name="testpdopgsql" value=1 <?php echo !empty($testpdopgsql) ? 'checked' : '' ?>> <b>PgSQL PDO</b><br>
+<input type=checkbox name="testpdomysql" value=1 <?php echo !empty($testpdomysql) ? 'checked' : '' ?>> <b>MySQL PDO</b><br>
+<input type=checkbox name="testpdosqlite" value=1 <?php echo !empty($testpdosqlite) ? 'checked' : '' ?>> <b>SQLite PDO</b><br>
+<input type=checkbox name="testpdoaccess" value=1 <?php echo !empty($testpdoaccess) ? 'checked' : '' ?>> <b>Access PDO</b><br>
+
+<td><input type=checkbox name="testdb2" value=1 <?php echo !empty($testdb2) ? 'checked' : '' ?>> DB2<br>
+<input type=checkbox name="testvfp" value=1 <?php echo !empty($testvfp) ? 'checked' : '' ?>> VFP+ODBTP<br>
+<input type=checkbox name="testado" value=1 <?php echo !empty($testado) ? 'checked' : '' ?>> ADO (for mssql and access)<br>
+<input type=checkbox name="nocountrecs" value=1 <?php echo !empty($nocountrecs) ? 'checked' : '' ?>> $ADODB_COUNTRECS=false<br>
+<input type=checkbox name="nolog" value=1 <?php echo !empty($nolog) ? 'checked' : '' ?>> No SQL Logging<br>
+<input type=checkbox name="time" value=1 <?php echo !empty($_GET['time']) ? 'checked' : '' ?>> ADOdb time test
+</table>
+<input type=submit>
+</form>
+
+<?php
+
+if ($ADODB_FETCH_MODE != ADODB_FETCH_DEFAULT) print "<h3>FETCH MODE IS NOT ADODB_FETCH_DEFAULT</h3>";
+
+if (isset($nocountrecs)) $ADODB_COUNTRECS = false;
+
+// cannot test databases below, but we include them anyway to check
+// if they parse ok...
+
+if (!strpos(PHP_VERSION,'5') === 0) {
+	ADOLoadCode("sybase");
+	//ADOLoadCode("postgres");
+	//ADOLoadCode("postgres7");
+	ADOLoadCode("firebird");
+	ADOLoadCode("borland_ibase");
+	ADOLoadCode("informix");
+	ADOLoadCode("sqlanywhere");
+//	ADOLoadCode('mysqli');
+}
+
+
+flush();
+if (!empty($testpostgres)) {
+	//ADOLoadCode("postgres");
+
+	$db = &ADONewConnection('postgres');
+	print "<h1>Connecting $db->databaseType...</h1>";
+	if ($db->Connect("localhost","tester","test","test")) {
+		testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)");
+	}else
+		print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.<BR>".$db->ErrorMsg();
+}
+
+if (!empty($testpgodbc)) { 
+	
+	$db = &ADONewConnection('odbc');
+	$db->hasTransactions = false;
+	print "<h1>Connecting $db->databaseType...</h1>";
+	
+	if ($db->PConnect('Postgresql')) {
+		$db->hasTransactions = true;
+		testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
+	} else print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.<BR>".$db->ErrorMsg();
+}
+
+if (!empty($testibase)) {
+	//$_GET['nolog'] = true;
+	$db = &ADONewConnection('firebird');
+	print "<h1>Connecting $db->databaseType...</h1>";
+	if ($db->PConnect("localhost:d:\\firebird\\151\\examples\\EMPLOYEE.fdb", "sysdba", "masterkey", ""))
+		testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname char(24),price numeric(12,2),created date)");
+	 else print "ERROR: Interbase test requires a database called employee.gdb".'<BR>'.$db->ErrorMsg();
+	
+}
+
+
+if (!empty($testsqlite)) {
+	$path =urlencode('d:\inetpub\adodb\sqlite.db');
+	$dsn = "sqlite://$path/";
+	$db = ADONewConnection($dsn);
+	echo $dsn;
+	
+//	$db = &ADONewConnection('sqlite');
+	print "<h1>Connecting $db->databaseType...</h1>";
+	
+	if (1)
+	//if ($db->PConnect("d:\\inetpub\\adodb\\sqlite.db", "", "", ""))
+		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
+	else print "ERROR: SQLite";
+	
+}
+
+if (!empty($testpdopgsql)) {
+	$connstr = "pgsql:dbname=test";
+	$u = 'tester';$p='test';
+	$db = &ADONewConnection('pdo');
+	$db->hasTransactions = false;
+	print "<h1>Connecting $db->databaseType...</h1>";
+	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
+	testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
+}
+
+if (!empty($testpdomysql)) {
+	$connstr = "mysql:dbname=northwind";
+	$u = 'root';$p='';
+	$db = &ADONewConnection('pdo');
+	$db->hasTransactions = false;
+	print "<h1>Connecting $db->databaseType...</h1>";
+	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
+	testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
+}
+
+if (!empty($testpdosqlite)) {
+	$connstr = "sqlite:d:/inetpub/adodb/sqlite-pdo.db3";
+	$u = '';$p='';
+	$db = &ADONewConnection('pdo');
+	$db->hasTransactions = false;
+	print "<h1>Connecting $db->databaseType...</h1>";
+	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
+	testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
+}
+
+if (!empty($testpdoaccess)) {
+	$connstr = 'odbc:nwind';
+	$u = '';$p='';
+	$db = &ADONewConnection('pdo');
+	$db->hasTransactions = false;
+	print "<h1>Connecting $db->databaseType...</h1>";
+	$db->Connect($connstr,$u,$p) || die("CONNECT FAILED");
+	testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
+}
+
+// REQUIRES ODBC DSN CALLED nwind
+if (!empty($testaccess)) {
+	$db = &ADONewConnection('access');
+	print "<h1>Connecting $db->databaseType...</h1>";
+	$access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
+	$dsn = "nwind";
+	$dsn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=$access;Uid=Admin;Pwd=;";
+	
+	//$dsn =  'Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=' . $access . ';';
+	if ($db->PConnect($dsn, "", "", ""))
+		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
+	else print "ERROR: Access test requires a Windows ODBC DSN=nwind, Access driver";
+	
+}
+
+if (!empty($testaccess) && !empty($testado)) { // ADO ACCESS
+
+	$db = &ADONewConnection("ado_access");
+	print "<h1>Connecting $db->databaseType...</h1>";
+	
+	$access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
+	$myDSN =  'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
+		. 'DATA SOURCE=' . $access . ';';
+		//. 'USER ID=;PASSWORD=;';
+	$_GET['nolog'] = 1;
+	if ($db->PConnect($myDSN, "", "", "")) {
+		print "ADO version=".$db->_connectionID->version."<br>";
+		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
+	} else print "ERROR: Access test requires a Access database $access".'<BR>'.$db->ErrorMsg();
+	
+}
+
+if (!empty($testvfp)) { // ODBC
+	$db = &ADONewConnection('vfp');
+	print "<h1>Connecting $db->databaseType...</h1>";flush();
+
+	if ( $db->PConnect("vfp-adoxyz")) {
+		testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
+	 } else print "ERROR: Visual FoxPro test requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
+	
+	echo "<hr>";
+	$db = &ADONewConnection('odbtp');
+	
+	if ( $db->PConnect('localhost','DRIVER={Microsoft Visual FoxPro Driver};SOURCETYPE=DBF;SOURCEDB=d:\inetpub\adodb;EXCLUSIVE=NO;')) {
+	print "<h1>Connecting $db->databaseType...</h1>";flush();
+	testdb($db,"create table d:\\inetpub\\adodb\\ADOXYZ (id int, firstname char(24), lastname char(24),created date)");
+	 } else print "ERROR: Visual FoxPro odbtp requires a Windows ODBC DSN=vfp-adoxyz, VFP driver";
+	
+}
+
+
+// REQUIRES MySQL server at localhost with database 'test'
+if (!empty($testmysql)) { // MYSQL
+
+
+	if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
+	else $server = "mangrove";
+	$user = 'root'; $password = ''; $database = 'northwind';
+	$db = &ADONewConnection("mysqlt://$user:$password@$server/$database?persist");
+	print "<h1>Connecting $db->databaseType...</h1>";
+	
+	if (true || $db->PConnect($server, "root", "", "northwind")) {
+		//$db->Execute("DROP TABLE ADOXYZ") || die('fail drop');
+		//$db->debug=1;$db->Execute('drop table ADOXYZ');
+		testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) Type=InnoDB");
+	} else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
+}
+
+// REQUIRES MySQL server at localhost with database 'test'
+if (!empty($testmysqli)) { // MYSQL
+
+	$db = &ADONewConnection('mysqli');
+	print "<h1>Connecting $db->databaseType...</h1>";
+	if (PHP_VERSION >= 5 || $_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
+	else $server = "mangrove";
+	if ($db->PConnect($server, "root", "", "northwind")) {
+		//$db->debug=1;$db->Execute('drop table ADOXYZ');
+		testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)");
+	} else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
+}
+
+
+// REQUIRES MySQL server at localhost with database 'test'
+if (!empty($testmysqlodbc)) { // MYSQL
+	
+	$db = &ADONewConnection('odbc');
+	$db->hasTransactions = false;
+	print "<h1>Connecting $db->databaseType...</h1>";
+	if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
+	else $server = "mangrove";
+	if ($db->PConnect('mysql', "root", ""))
+		testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
+	else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
+}
+
+if (!empty($testproxy)){
+	$db = &ADONewConnection('proxy');
+	print "<h1>Connecting $db->databaseType...</h1>";
+	if ($_SERVER['HTTP_HOST'] == 'localhost') $server = 'localhost';
+
+	if ($db->PConnect('http://localhost/php/phplens/adodb/server.php'))
+		testdb($db,
+		"create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
+	else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
+
+}
+
+ADOLoadCode('oci805');
+ADOLoadCode("oci8po");
+if (!empty($testoracle)) {
+	$dsn = "oci8po://scott:natsoft@sherkhan?persist";
+	$db = ADONewConnection($dsn);
+	print "<h1>Connecting $db->databaseType...</h1>";
+	if (true || $db->Connect('', "scott", "natsoft",''))
+		testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
+	else print "ERROR: Oracle test requires an Oracle server setup with scott/natsoft".'<BR>'.$db->ErrorMsg();
+
+}
+ADOLoadCode("oracle"); // no longer supported
+if (false && !empty($testoracle)) { 
+	
+	$db = ADONewConnection();
+	print "<h1>Connecting $db->databaseType...</h1>";
+	if ($db->PConnect("", "scott", "tiger", "natsoft.domain"))
+		testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
+	else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".'<BR>'.$db->ErrorMsg();
+
+}
+
+ADOLoadCode("db2"); // no longer supported
+if (!empty($testdb2)) { 
+	$db = ADONewConnection();
+	print "<h1>Connecting $db->databaseType...</h1>";
+	
+	$dsn = "db2_sample";
+	$dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
+	if ($db->Connect($dsn)) {
+	//	testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
+	} else print "ERROR: DB2 test requires an server setup with odbc data source db2_sample".'<BR>'.$db->ErrorMsg();
+
+echo "<hr>";
+flush();
+	$dsn = "driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP; uid=root; pwd=natsoft";
+	
+	$db = ADONewConnection('odbtp');
+	if ($db->Connect('127.0.0.1',$dsn)) {
+		
+		$db->debug=1;
+		 $arr = $db->GetArray( "||SQLProcedures" ); adodb_pr($arr);
+	     $arr = $db->GetArray( "||SQLProcedureColumns|||GET_ROUTINE_SAR" );adodb_pr($arr);
+	
+		testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
+	} else echo ("ERROR Connection");
+	echo $db->ErrorMsg();
+}
+
+
+$server = 'sherkhan';
+
+ADOLoadCode('odbc_mssql');
+if (!empty($testmssql)) { // MS SQL Server via ODBC
+	$db = ADONewConnection();
+	
+	print "<h1>Connecting $db->databaseType...</h1>";
+	
+	$dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;";
+	
+	if ($db->PConnect($dsn, "adodb", "natsoft", ""))  {
+		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
+	}
+	else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
+
+}
+
+ADOLoadCode("ado_mssql");
+if (!empty($testmssql) && !empty($testado) ) { // ADO ACCESS MSSQL -- thru ODBC -- DSN-less
+	
+	$db = &ADONewConnection("ado_mssql");
+	//$db->debug=1;
+	print "<h1>Connecting DSN-less $db->databaseType...</h1>";
+	
+	$myDSN="PROVIDER=MSDASQL;DRIVER={SQL Server};"
+		. "SERVER=$server;DATABASE=NorthWind;UID=adodb;PWD=natsoft;Trusted_Connection=No";
+
+		
+	if ($db->PConnect($myDSN, "", "", ""))
+		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
+	else print "ERROR: MSSQL test 2 requires MS SQL 7";
+	
+}
+
+
+ADOLoadCode("mssqlpo");
+if (!empty($testmssql)) { // MS SQL Server -- the extension is buggy -- probably better to use ODBC
+	$db = ADONewConnection("mssqlpo");
+	//$db->debug=1;
+	print "<h1>Connecting $db->databaseType...</h1>";
+	
+	$ok = $db->Connect('','adodb','natsoft','northwind');
+
+	if ($ok or $db->PConnect("mangrove", "sa", "natsoft", "ai")) {
+		AutoDetect_MSSQL_Date_Order($db);
+	//	$db->Execute('drop table adoxyz');
+		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
+	} else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='192.168.0.1', userid='adodb', password='natsoft', database='ai'".'<BR>'.$db->ErrorMsg();
+	
+}
+
+if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider
+
+	$db = &ADONewConnection("ado_mssql");
+	print "<h1>Connecting DSN-less OLEDB Provider $db->databaseType...</h1>";
+	//$db->debug=1;
+	$myDSN="SERVER=localhost;DATABASE=northwind;Trusted_Connection=yes";
+	if ($db->PConnect($myDSN, "adodb", "natsoft", 'SQLOLEDB')) {
+		testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
+	} else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'";
+
+}
+
+
+if (extension_loaded('odbtp') && !empty($testmssql)) { // MS SQL Server via ODBC
+	$db = ADONewConnection('odbtp');
+	
+	$dsn = "PROVIDER=MSDASQL;Driver={SQL Server};Server=$server;Database=northwind;uid=adodb;pwd=natsoft";
+	
+	if ($db->PConnect('localhost',$dsn, "", ""))  {
+		print "<h1>Connecting $db->databaseType...</h1>";				
+		testdb($db,"create table ADOXYZ (id int, firstname char(24) null, lastname char(24) null,created datetime null)");
+	}
+	else print "ERROR: MSSQL test 1 requires a MS SQL 7 server setup with DSN setup";
+
+}
+
+
+print "<h3>Tests Completed</h3>";
+
+?>

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testgenid.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testgenid.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testgenid.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,36 @@
+<?php
+/*
+	V4.50 6 July 2004 
+	
+	Run multiple copies of this php script at the same time
+	to test unique generation of id's in multiuser mode
+*/
+include_once('../adodb.inc.php');
+$testaccess = true;
+include_once('testdatabases.inc.php');
+
+function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
+{
+	$table = 'adodbseq';
+	
+	$db->Execute("drop table $table");
+	//$db->debug=true;
+	
+	$ctr = 5000;
+	$lastnum = 0;
+	
+	while (--$ctr >= 0) {
+		$num = $db->GenID($table);
+		if ($num === false) {	
+			print "GenID returned false";
+			break;
+		}
+		if ($lastnum + 1 == $num) print " $num ";
+		else {
+			print " <font color=red>$num</font> ";
+			flush();
+		}
+		$lastnum = $num;
+	}
+}
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testmssql.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testmssql.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testmssql.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,76 @@
+<?php
+
+/** 
+ * @version V4.50 6 July 2004 (c) 2000-2005 John Lim (jlim at 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. 
+ *
+ * Set tabs to 4 for best viewing.
+ * 
+ * Latest version is available at http://php.weblogs.com
+ *
+ * Test GetUpdateSQL and GetInsertSQL.
+ */
+ 
+error_reporting(E_ALL);
+
+
+include('../adodb.inc.php');
+include('../tohtml.inc.php');
+
+//==========================
+// This code tests an insert
+
+
+
+$conn = &ADONewConnection("mssql");  // create a connection
+$conn->Connect('127.0.0.1','adodb','natsoft','northwind') or die('Fail');
+
+$conn->debug =1;
+$query = 'select * from products';
+$conn->SetFetchMode(ADODB_FETCH_ASSOC);
+$rs = $conn->Execute($query);
+echo "<pre>";
+while( !$rs->EOF ) {
+	$output[] = $rs->fields;
+	var_dump($rs->fields);
+	$rs->MoveNext();
+	print "<p>";
+}
+die();
+
+
+$p = $conn->Prepare('insert into products (productname,unitprice,dcreated) values (?,?,?)');
+echo "<pre>";
+print_r($p);
+
+$conn->debug=1;
+$conn->Execute($p,array('John'.rand(),33.3,$conn->DBDate(time())));
+
+$p = $conn->Prepare('select * from products where productname like ?');
+$arr = $conn->getarray($p,array('V%'));
+print_r($arr);
+die();
+
+//$conn = &ADONewConnection("mssql");
+//$conn->Connect('mangrove','sa','natsoft','ai');
+
+//$conn->Connect('mangrove','sa','natsoft','ai');
+$conn->debug=1;
+$conn->Execute('delete from blobtest');
+
+$conn->Execute('insert into blobtest (id) values(1)');
+$conn->UpdateBlobFile('blobtest','b1','../cute_icons_for_site/adodb.gif','id=1');
+$rs = $conn->Execute('select b1 from blobtest where id=1');
+
+$output = "c:\\temp\\test_out-".date('H-i-s').".gif"; 
+print "Saving file <b>$output</b>, size=".strlen($rs->fields[0])."<p>";
+$fd = fopen($output, "wb"); 
+fwrite($fd, $rs->fields[0]); 
+fclose($fd); 
+
+print " <a href=file://$output>View Image</a>";
+//$rs = $conn->Execute('SELECT id,SUBSTRING(b1, 1, 10) FROM blobtest');
+//rs2html($rs);
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,83 @@
+<html>
+<body>
+<?php
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+error_reporting(63);
+include("../adodb.inc.php");
+include("../tohtml.inc.php");
+
+if (0) {
+	$db = ADONewConnection('oci8po');
+	
+	$db->PConnect('','scott','natsoft');
+	if (!empty($testblob)) {
+		$varHoldingBlob = 'ABC DEF GEF John TEST';
+		$num = time()%10240;
+		// create table atable (id integer, ablob blob);
+		$db->Execute('insert into ATABLE (id,ablob) values('.$num.',empty_blob())');
+		$db->UpdateBlob('ATABLE', 'ablob', $varHoldingBlob, 'id='.$num, 'BLOB');
+		
+		$rs = &$db->Execute('select * from atable');
+		
+		if (!$rs) die("Empty RS");
+		if ($rs->EOF) die("EOF RS");
+		rs2html($rs);
+	}
+	$stmt = $db->Prepare('select * from adoxyz where id=?');
+	for ($i = 1; $i <= 10; $i++) {
+	$rs = &$db->Execute(
+		$stmt,
+		array($i));
+			
+		if (!$rs) die("Empty RS");
+		if ($rs->EOF) die("EOF RS");
+		rs2html($rs);
+	}
+}
+if (1) {
+	$db = ADONewConnection('oci8');
+	$db->PConnect('','scott','natsoft');
+	$db->debug = true;
+	$db->Execute("delete from emp where ename='John'");
+	print $db->Affected_Rows().'<BR>';
+	$stmt = &$db->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
+	$rs = $db->Execute($stmt,array('empno'=>4321,'ename'=>'John'));
+	// prepare not quite ready for prime time
+	//$rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John'));
+	if (!$rs) die("Empty RS");
+	
+	$db->setfetchmode(ADODB_FETCH_NUM);
+	
+	$vv = 'A%';
+	$stmt = $db->PrepareSP("BEGIN adodb.open_tab2(:rs,:tt); END;",true);
+	$db->OutParameter($stmt, $cur, 'rs', -1, OCI_B_CURSOR);
+	$db->OutParameter($stmt, $vv, 'tt');
+	$rs = $db->Execute($stmt);
+	while (!$rs->EOF) {
+		adodb_pr($rs->fields);
+		$rs->MoveNext();
+	}
+	echo " val = $vv";
+
+}
+
+if (0) {
+	$db = ADONewConnection('odbc_oracle');
+	if (!$db->PConnect('local_oracle','scott','tiger')) die('fail connect');
+	$db->debug = true;
+	$rs = &$db->Execute(
+		'select * from adoxyz where firstname=? and trim(lastname)=?',
+		array('first'=>'Caroline','last'=>'Miranda'));
+	if (!$rs) die("Empty RS");
+	if ($rs->EOF) die("EOF RS");
+	rs2html($rs);
+}
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8cursor.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8cursor.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testoci8cursor.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,111 @@
+<?php
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+
+/*
+	Test for Oracle Variable Cursors, which are treated as ADOdb recordsets.
+	
+	We have 2 examples. The first shows us using the Parameter statement. 
+	The second shows us using the new ExecuteCursor($sql, $cursorName)
+	function.
+	
+------------------------------------------------------------------
+-- TEST PACKAGE YOU NEED TO INSTALL ON ORACLE - run from sql*plus
+------------------------------------------------------------------
+
+
+-- TEST PACKAGE
+CREATE OR REPLACE PACKAGE adodb AS
+TYPE TabType IS REF CURSOR RETURN tab%ROWTYPE;
+PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames in varchar);
+PROCEDURE data_out(input IN varchar, output OUT varchar); 
+
+procedure myproc (p1 in number, p2 out number);
+END adodb;
+/
+
+CREATE OR REPLACE PACKAGE BODY adodb AS
+PROCEDURE open_tab (tabcursor IN OUT TabType,tablenames in varchar) IS
+	BEGIN
+		OPEN tabcursor FOR SELECT * FROM tab where tname like tablenames;
+	END open_tab;
+	
+PROCEDURE data_out(input IN varchar, output OUT varchar) IS
+	BEGIN
+		output := 'Cinta Hati '||input;
+	END;
+	
+procedure myproc (p1 in number, p2 out number) as
+begin
+p2 := p1;
+end;
+END adodb;
+/
+
+------------------------------------------------------------------
+-- END PACKAGE
+------------------------------------------------------------------
+
+*/
+
+include('../adodb.inc.php');
+include('../tohtml.inc.php');
+
+	error_reporting(E_ALL);
+	$db = ADONewConnection('oci8');
+	$db->PConnect('','scott','natsoft');
+	$db->debug = 99;
+
+
+/*
+*/
+
+	define('MYNUM',5);
+	
+
+	$rs = $db->ExecuteCursor("BEGIN adodb.open_tab(:RS,'A%'); END;");
+	
+	if ($rs && !$rs->EOF) {
+		print "Test 1 RowCount: ".$rs->RecordCount()."<p>";
+	} else {
+		print "<b>Error in using Cursor Variables 1</b><p>";
+	}
+	
+	print "<h4>Testing Stored Procedures for oci8</h4>";
+	
+	$stid = $db->PrepareSP('BEGIN adodb.myproc('.MYNUM.', :myov); END;');
+	$db->OutParameter($stid, $myov, 'myov');
+	$db->Execute($stid);
+	if ($myov != MYNUM) print "<p><b>Error with myproc</b></p>";
+	
+	
+	$stmt = $db->PrepareSP("BEGIN adodb.data_out(:a1, :a2); END;",true);
+	$a1 = 'Malaysia';
+	//$a2 = ''; # a2 doesn't even need to be defined!
+	$db->InParameter($stmt,$a1,'a1');
+	$db->OutParameter($stmt,$a2,'a2');
+	$rs = $db->Execute($stmt);
+	if ($rs) {
+		if ($a2 !== 'Cinta Hati Malaysia') print "<b>Stored Procedure Error: a2 = $a2</b><p>";
+		else echo  "OK: a2=$a2<p>";
+	} else {
+		print "<b>Error in using Stored Procedure IN/Out Variables</b><p>";
+	}
+	
+	
+	$tname = 'A%';
+	
+	$stmt = $db->PrepareSP('select * from tab where tname like :tablename');
+	$db->Parameter($stmt,$tname,'tablename');
+	$rs = $db->Execute($stmt);
+	rs2html($rs);
+		
+		
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testpaging.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testpaging.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testpaging.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,83 @@
+<?php
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+
+error_reporting(E_ALL);
+
+
+include_once('../adodb.inc.php');
+include_once('../adodb-pager.inc.php');
+
+$driver = 'oci8';
+$sql = 'select  ID, firstname as "First Name", lastname as "Last Name" from adoxyz  order  by  id';
+//$sql = 'select count(*),firstname from adoxyz group by firstname order by 2 ';
+$sql = 'select distinct firstname, lastname from adoxyz  order  by  firstname';
+
+if ($driver == 'postgres') {
+	$db = NewADOConnection('postgres');
+	$db->PConnect('localhost','tester','test','test');
+}
+
+if ($driver == 'access') {
+	$db = NewADOConnection('access');
+	$db->PConnect("nwind", "", "", "");
+}
+
+if ($driver == 'ibase') {
+	$db = NewADOConnection('ibase');
+	$db->PConnect("localhost:e:\\firebird\\examples\\employee.gdb", "sysdba", "masterkey", "");
+	$sql = 'select distinct firstname, lastname  from adoxyz  order  by  firstname';
+
+}
+if ($driver == 'mssql') {
+	$db = NewADOConnection('mssql');
+	$db->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
+}
+if ($driver == 'oci8') {
+	$db = NewADOConnection('oci8');
+	$db->Connect('','scott','natsoft');
+}
+
+if ($driver == 'access') {
+	$db = NewADOConnection('access');
+	$db->Connect('nwind');
+}
+
+if (empty($driver) or $driver == 'mysql') {
+	$db = NewADOConnection('mysql');
+	$db->Connect('localhost','root','','xphplens');
+}
+
+//$db->pageExecuteCountRows = false;
+
+$db->debug = true;
+
+if (0) {
+$rs = &$db->Execute($sql);
+include_once('../toexport.inc.php');
+print "<pre>";
+print rs2csv($rs); # return a string
+
+print '<hr>';
+$rs->MoveFirst(); # note, some databases do not support MoveFirst
+print rs2tab($rs); # return a string
+
+print '<hr>';
+$rs->MoveFirst();
+rs2tabout($rs); # send to stdout directly
+print "</pre>";
+}
+
+$pager = new ADODB_Pager($db,$sql);
+$pager->showPageLinks = true;
+$pager->linksPerPage = 3;
+$pager->cache = 60;
+$pager->Render($rows=7);
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testpear.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testpear.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testpear.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,34 @@
+<?php
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+
+error_reporting(E_ALL);
+
+include_once('../adodb-pear.inc.php');
+$username = 'root';
+$password = '';
+$hostname = 'localhost';
+$databasename = 'xphplens';
+$driver = 'mysql';
+
+$dsn = "$driver://$username:$password@$hostname/$databasename";
+
+$db = DB::Connect($dsn);
+$db->setFetchMode(ADODB_FETCH_ASSOC);
+$rs = $db->Query('select firstname,lastname from adoxyz');
+$cnt = 0;
+while ($arr = $rs->FetchRow()) {
+	print_r($arr);
+	print "<br>";
+	$cnt += 1;
+}
+
+if ($cnt != 50) print "<b>Error in \$cnt = $cnt</b>";
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/testsessions.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/testsessions.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/testsessions.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,81 @@
+<?php
+
+/* 
+V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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. 
+  Set tabs to 4 for best viewing.
+	
+  Latest version is available at http://adodb.sourceforge.net
+*/
+
+function NotifyExpire($ref,$key)
+{
+	print "<p><b>Notify Expiring=$ref, sessionkey=$key</b></p>";
+}
+
+//-------------------------------------------------------------------
+	
+	
+#### CONNECTION
+if (0) {
+	$ADODB_SESSION_DRIVER='oci8';
+	$ADODB_SESSION_CONNECT='';
+	$ADODB_SESSION_USER ='scott';
+	$ADODB_SESSION_PWD ='natsoft';
+	$ADODB_SESSION_DB ='';
+} else {
+	$ADODB_SESSION_DRIVER='mysql';
+	$ADODB_SESSION_CONNECT='localhost';
+	$ADODB_SESSION_USER ='root';
+	$ADODB_SESSION_PWD ='';
+	$ADODB_SESSION_DB ='xphplens_2';
+}
+	
+### TURN DEBUGGING ON
+	$ADODB_SESS_DEBUG = 99;
+
+	
+#### SETUP NOTIFICATION
+	$USER = 'JLIM'.rand();
+	$ADODB_SESSION_EXPIRE_NOTIFY = array('USER','NotifyExpire');
+
+	
+#### INIT
+	ob_start();
+	error_reporting(E_ALL);
+	include('../session/adodb-cryptsession.php');
+	session_start();
+
+	adodb_session_regenerate_id();
+	
+### SETUP SESSION VARIABLES 
+	$_SESSION['MONKEY'] = array('1','abc',44.41);
+	if (!isset($_GET['nochange'])) @$_SESSION['AVAR'] += 1;
+
+	
+### START DISPLAY
+	print "<h3>PHP ".PHP_VERSION."</h3>";
+	print "<p><b>\$_SESSION['AVAR']={$_SESSION['AVAR']}</b></p>";
+	
+	print "<hr> <b>Cookies</b>: ";
+	print_r($_COOKIE);
+	
+### RANDOMLY PERFORM Garbage Collection
+### In real-production environment, this is done for you
+### by php's session extension, which calls adodb_sess_gc()
+### automatically for you. See php.ini's
+### session.cookie_lifetime and session.gc_probability
+
+	if (rand() % 5 == 0) {
+	
+		print "<hr><p><b>Garbage Collection</b></p>";
+		adodb_sess_gc(10);
+		
+		if (rand() % 2 == 0) {
+			print "<p>Random session destroy</p>";
+			session_destroy();
+		}
+	}
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/time.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/time.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/time.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,17 @@
+<?php
+
+include_once('../adodb-time.inc.php');
+//adodb_date_test();
+?>
+<?php 
+//require("adodb-time.inc.php"); 
+
+$datestring = "1963-12-04"; // string normally from mySQL 
+$stringArray = explode("-", $datestring);
+$date = adodb_mktime(0,0,0,$stringArray[1],$stringArray[2],$stringArray[0]); 
+
+$convertedDate = date("d-M-Y", $date); // converted string to UK style date
+
+echo( "Birthday: $convertedDate" ); //why is string returned as one day (3 not 4) less for this example??
+
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/tmssql.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/tmssql.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/tmssql.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,65 @@
+<?php
+error_reporting(E_ALL);
+ini_set('mssql.datetimeconvert',0); 
+
+function tmssql()
+{
+	print "<h3>mssql</h3>";
+	$db = mssql_connect('JAGUAR\vsdotnet','adodb','natsoft') or die('No Connection');
+	mssql_select_db('northwind',$db);
+	
+	$rs = mssql_query('select getdate() as date',$db);
+	$o = mssql_fetch_row($rs);
+	print_r($o);
+	mssql_free_result($rs);
+	
+	print "<p>Delete</p>"; flush();
+	$rs2 = mssql_query('delete from adoxyz',$db);
+	$p = mssql_num_rows($rs2);
+	mssql_free_result($rs2);
+
+}
+
+function tpear()
+{
+include_once('DB.php');
+
+	print "<h3>PEAR</h3>";
+	$username = 'adodb';
+	$password = 'natsoft';
+	$hostname = 'JAGUAR\vsdotnet';
+	$databasename = 'northwind';
+	
+	$dsn = "mssql://$username:$password@$hostname/$databasename";
+	$conn = &DB::connect($dsn);
+	print "date=".$conn->GetOne('select getdate()')."<br>";
+	@$conn->query('create table tester (id integer)');
+	print "<p>Delete</p>"; flush();
+	$rs = $conn->query('delete from tester');
+	print "date=".$conn->GetOne('select getdate()')."<br>";
+}
+
+function tadodb()
+{
+include_once('../adodb.inc.php');
+
+	print "<h3>ADOdb</h3>";
+	$conn = NewADOConnection('mssql');
+	$conn->Connect('JAGUAR\vsdotnet','adodb','natsoft','northwind');
+//	$conn->debug=1;
+	print "date=".$conn->GetOne('select getdate()')."<br>";
+	$conn->Execute('create table tester (id integer)');
+	print "<p>Delete</p>"; flush();
+	$rs = $conn->Execute('delete from tester');
+	print "date=".$conn->GetOne('select getdate()')."<br>";
+}
+?>
+<a href=tmssql.php?do=tmssql>mssql</a>
+<a href=tmssql.php?do=tpear>pear</a>
+<a href=tmssql.php?do=tadodb>adodb</a>
+<?php
+if (!empty($_GET['do'])) {
+	$do = $_GET['do'];
+	$do();
+}
+?>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/tests/xmlschema.xml
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tests/xmlschema.xml	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tests/xmlschema.xml	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<schema version="0.2">
+  <table name="mytable">
+    <field name="row1" type="I">
+      <descr>An integer row that's a primary key and autoincrements</descr>
+      <KEY/>
+      <AUTOINCREMENT/>
+    </field>
+    <field name="row2" type="C" size="16">
+      <descr>A 16 character varchar row that can't be null</descr>
+      <NOTNULL/>
+    </field>
+    <index name="myindex">
+      <col>row1</col>
+      <col>row2</col>
+    </index>
+  </table>
+  <sql>
+    <descr>SQL to be executed only on specific platforms</descr>
+    <query platform="postgres|postgres7">
+      insert into mytable ( row1, row2 ) values ( 12, 'postgres stuff' )
+    </query>
+    <query platform="mysql">
+      insert into mytable ( row1, row2 ) values ( 12, 'mysql stuff' )
+    </query>
+	<query platform="mssql">
+      insert into mytable ( row1, row2 ) values ( 12, 'Microsoft stuff' )
+    </query>
+  </sql>
+  <table name="obsoletetable">
+    <DROP/>
+  </table>
+</schema>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/class/database/adodb/toexport.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/toexport.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/toexport.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,7 +1,7 @@
 <?php
 
 /** 
- * @version V4.54 5 Nov 2004 (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+ * @version V4.62 2 Apr 2005 (c) 2000-2005 John Lim (jlim at 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. 
@@ -77,7 +77,7 @@
 			
 			$v = $o->name;
 			if ($escquote) $v = str_replace($quote,$escquotequote,$v);
-			$v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)));
+			$v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
 			$elements[] = $v;
 			
 		}
@@ -98,7 +98,7 @@
 				if (!is_object($v)) $v = trim($v);
 				else $v = 'Object';
 				if ($escquote) $v = str_replace($quote,$escquotequote,$v);
-				$v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)));
+				$v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
 				
 				if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
 				else $elements[] = $v;
@@ -106,7 +106,7 @@
 		} else { // ASSOCIATIVE ARRAY
 			foreach($rs->fields as $v) {
 				if ($escquote) $v = str_replace($quote,$escquotequote,trim($v));
-				$v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)));
+				$v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v))));
 				
 				if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote";
 				else $elements[] = $v;

Modified: plog/branches/plog-1.0.1/class/database/adodb/tohtml.inc.php
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/tohtml.inc.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/tohtml.inc.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -1,6 +1,6 @@
 <?php 
 /*
-  V4.54 5 Nov 2004  (c) 2000-2004 John Lim (jlim at natsoft.com.my). All rights reserved.
+  V4.62 2 Apr 2005  (c) 2000-2005 John Lim (jlim at 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.

Added: plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.1-0.2.xsl
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.1-0.2.xsl	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.1-0.2.xsl	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+	<xsl:output method="xml" indent="yes" omit-xml-declaration="no" encoding="UTF-8"/>
+	
+	<!-- Schema -->
+	<xsl:template match="/">
+		<xsl:comment>
+ADODB XMLSchema
+http://adodb-xmlschema.sourceforge.net
+</xsl:comment>
+		
+		<xsl:element name="schema">
+			<xsl:attribute name="version">0.2</xsl:attribute>
+			
+			<xsl:apply-templates select="schema/table|schema/sql"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Table -->
+	<xsl:template match="table">
+		<xsl:variable name="table_name" select="@name"/>
+		
+		<xsl:element name="table">
+			<xsl:attribute name="name"><xsl:value-of select="$table_name"/></xsl:attribute>
+			
+			<xsl:if test="string-length(@platform) > 0">
+				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:if test="string-length(@version) > 0">
+				<xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:apply-templates select="descr[1]"/>
+			
+			<xsl:choose>
+				<xsl:when test="count(DROP) > 0">
+					<xsl:element name="DROP"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="field"/>
+				</xsl:otherwise>
+			</xsl:choose>
+			
+			<xsl:apply-templates select="constraint"/>
+			
+			<xsl:apply-templates select="../index[@table=$table_name]"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Field -->
+	<xsl:template match="field">
+		<xsl:element name="field">
+			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+			<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
+			
+			<xsl:if test="string-length(@size) > 0">
+				<xsl:attribute name="size"><xsl:value-of select="@size"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:choose>
+				<xsl:when test="count(PRIMARY) > 0">
+					<xsl:element name="PRIMARY"/>
+				</xsl:when>
+				<xsl:when test="count(KEY) > 0">
+					<xsl:element name="KEY"/>
+				</xsl:when>
+				<xsl:when test="count(NOTNULL) > 0">
+					<xsl:element name="NOTNULL"/>
+				</xsl:when>
+			</xsl:choose>
+			
+			<xsl:choose>
+				<xsl:when test="count(AUTO) > 0">
+					<xsl:element name="AUTO"/>
+				</xsl:when>
+				<xsl:when test="count(AUTOINCREMENT) > 0">
+					<xsl:element name="AUTOINCREMENT"/>
+				</xsl:when>
+			</xsl:choose>
+			
+			<xsl:choose>
+				<xsl:when test="count(DEFAULT) > 0">
+					<xsl:element name="DEFAULT">
+						<xsl:attribute name="value">
+							<xsl:value-of select="DEFAULT[1]/@value"/>
+						</xsl:attribute>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="count(DEFDATE) > 0">
+					<xsl:element name="DEFDATE">
+						<xsl:attribute name="value">
+							<xsl:value-of select="DEFDATE[1]/@value"/>
+						</xsl:attribute>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="count(DEFTIMESTAMP) > 0">
+					<xsl:element name="DEFDTIMESTAMP">
+						<xsl:attribute name="value">
+							<xsl:value-of select="DEFTIMESTAMP[1]/@value"/>
+						</xsl:attribute>
+					</xsl:element>
+				</xsl:when>
+			</xsl:choose>
+			
+			<xsl:if test="count(NOQUOTE) > 0">
+				<xsl:element name="NOQUOTE"/>
+			</xsl:if>
+			
+			<xsl:apply-templates select="constraint"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Constraint -->
+	<xsl:template match="constraint">
+		<xsl:element name="constraint">
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Index -->
+	<xsl:template match="index">
+		<xsl:element name="index">
+			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+			
+			<xsl:apply-templates select="descr[1]"/>
+			
+			<xsl:if test="count(CLUSTERED) > 0">
+				<xsl:element name="CLUSTERED"/>
+			</xsl:if>
+			
+			<xsl:if test="count(BITMAP) > 0">
+				<xsl:element name="BITMAP"/>
+			</xsl:if>
+			
+			<xsl:if test="count(UNIQUE) > 0">
+				<xsl:element name="UNIQUE"/>
+			</xsl:if>
+			
+			<xsl:if test="count(FULLTEXT) > 0">
+				<xsl:element name="FULLTEXT"/>
+			</xsl:if>
+			
+			<xsl:if test="count(HASH) > 0">
+				<xsl:element name="HASH"/>
+			</xsl:if>
+			
+			<xsl:choose>
+				<xsl:when test="count(DROP) > 0">
+					<xsl:element name="DROP"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="col"/>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Index Column -->
+	<xsl:template match="col">
+		<xsl:element name="col">
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- SQL QuerySet -->
+	<xsl:template match="sql">
+		<xsl:element name="sql">
+			<xsl:if test="string-length(@platform) > 0">
+				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:if test="string-length(@key) > 0">
+				<xsl:attribute name="key"><xsl:value-of select="@key"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:if test="string-length(@prefixmethod) > 0">
+				<xsl:attribute name="prefixmethod"><xsl:value-of select="@prefixmethod"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:apply-templates select="descr[1]"/>
+			<xsl:apply-templates select="query"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Query -->
+	<xsl:template match="query">
+		<xsl:element name="query">
+			<xsl:if test="string-length(@platform) > 0">
+				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Description -->
+	<xsl:template match="descr">
+		<xsl:element name="descr">
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.2-0.1.xsl
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.2-0.1.xsl	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/xsl/convert-0.2-0.1.xsl	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+	<xsl:output method="xml" indent="yes" omit-xml-declaration="no" encoding="UTF-8"/>
+	
+	<!-- Schema -->
+	<xsl:template match="/">
+		<xsl:comment>
+ADODB XMLSchema
+http://adodb-xmlschema.sourceforge.net
+</xsl:comment>
+		
+		<xsl:element name="schema">
+			<xsl:attribute name="version">0.1</xsl:attribute>
+			
+			<xsl:apply-templates select="schema/table|schema/sql"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Table -->
+	<xsl:template match="table">
+		<xsl:variable name="table_name" select="@name"/>
+		
+		<xsl:element name="table">
+			<xsl:attribute name="name"><xsl:value-of select="$table_name"/></xsl:attribute>
+			
+			<xsl:if test="string-length(@platform) > 0">
+				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:if test="string-length(@version) > 0">
+				<xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:apply-templates select="descr[1]"/>
+			
+			<xsl:choose>
+				<xsl:when test="count(DROP) > 0">
+					<xsl:element name="DROP"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="field"/>
+				</xsl:otherwise>
+			</xsl:choose>
+			
+			<xsl:apply-templates select="constraint"/>
+			
+		</xsl:element>
+		
+		<xsl:apply-templates select="index"/>
+	</xsl:template>
+	
+	<!-- Field -->
+	<xsl:template match="field">
+		<xsl:element name="field">
+			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+			<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
+			
+			<xsl:if test="string-length(@size) > 0">
+				<xsl:attribute name="size"><xsl:value-of select="@size"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:choose>
+				<xsl:when test="count(PRIMARY) > 0">
+					<xsl:element name="PRIMARY"/>
+				</xsl:when>
+				<xsl:when test="count(KEY) > 0">
+					<xsl:element name="KEY"/>
+				</xsl:when>
+				<xsl:when test="count(NOTNULL) > 0">
+					<xsl:element name="NOTNULL"/>
+				</xsl:when>
+			</xsl:choose>
+			
+			<xsl:choose>
+				<xsl:when test="count(AUTO) > 0">
+					<xsl:element name="AUTO"/>
+				</xsl:when>
+				<xsl:when test="count(AUTOINCREMENT) > 0">
+					<xsl:element name="AUTOINCREMENT"/>
+				</xsl:when>
+			</xsl:choose>
+			
+			<xsl:choose>
+				<xsl:when test="count(DEFAULT) > 0">
+					<xsl:element name="DEFAULT">
+						<xsl:attribute name="value">
+							<xsl:value-of select="DEFAULT[1]/@value"/>
+						</xsl:attribute>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="count(DEFDATE) > 0">
+					<xsl:element name="DEFDATE">
+						<xsl:attribute name="value">
+							<xsl:value-of select="DEFDATE[1]/@value"/>
+						</xsl:attribute>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="count(DEFTIMESTAMP) > 0">
+					<xsl:element name="DEFDTIMESTAMP">
+						<xsl:attribute name="value">
+							<xsl:value-of select="DEFTIMESTAMP[1]/@value"/>
+						</xsl:attribute>
+					</xsl:element>
+				</xsl:when>
+			</xsl:choose>
+			
+			<xsl:if test="count(NOQUOTE) > 0">
+				<xsl:element name="NOQUOTE"/>
+			</xsl:if>
+			
+			<xsl:apply-templates select="constraint"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Constraint -->
+	<xsl:template match="constraint">
+		<xsl:element name="constraint">
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Index -->
+	<xsl:template match="index">
+		<xsl:element name="index">
+			<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+			<xsl:attribute name="table"><xsl:value-of select="../@name"/></xsl:attribute>
+			
+			<xsl:apply-templates select="descr[1]"/>
+			
+			<xsl:if test="count(CLUSTERED) > 0">
+				<xsl:element name="CLUSTERED"/>
+			</xsl:if>
+			
+			<xsl:if test="count(BITMAP) > 0">
+				<xsl:element name="BITMAP"/>
+			</xsl:if>
+			
+			<xsl:if test="count(UNIQUE) > 0">
+				<xsl:element name="UNIQUE"/>
+			</xsl:if>
+			
+			<xsl:if test="count(FULLTEXT) > 0">
+				<xsl:element name="FULLTEXT"/>
+			</xsl:if>
+			
+			<xsl:if test="count(HASH) > 0">
+				<xsl:element name="HASH"/>
+			</xsl:if>
+			
+			<xsl:choose>
+				<xsl:when test="count(DROP) > 0">
+					<xsl:element name="DROP"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="col"/>
+				</xsl:otherwise>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Index Column -->
+	<xsl:template match="col">
+		<xsl:element name="col">
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- SQL QuerySet -->
+	<xsl:template match="sql">
+		<xsl:element name="sql">
+			<xsl:if test="string-length(@platform) > 0">
+				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:if test="string-length(@key) > 0">
+				<xsl:attribute name="key"><xsl:value-of select="@key"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:if test="string-length(@prefixmethod) > 0">
+				<xsl:attribute name="prefixmethod"><xsl:value-of select="@prefixmethod"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:apply-templates select="descr[1]"/>
+			<xsl:apply-templates select="query"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Query -->
+	<xsl:template match="query">
+		<xsl:element name="query">
+			<xsl:if test="string-length(@platform) > 0">
+				<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Description -->
+	<xsl:template match="descr">
+		<xsl:element name="descr">
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Added: plog/branches/plog-1.0.1/class/database/adodb/xsl/remove-0.2.xsl
===================================================================
--- plog/branches/plog-1.0.1/class/database/adodb/xsl/remove-0.2.xsl	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/class/database/adodb/xsl/remove-0.2.xsl	2005-04-08 19:43:46 UTC (rev 1788)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+	<xsl:output method="xml" indent="yes" omit-xml-declaration="no" encoding="UTF-8"/>
+	
+	<!-- Schema -->
+	<xsl:template match="/">
+		<xsl:comment>
+ADODB XMLSchema
+http://adodb-xmlschema.sourceforge.net
+</xsl:comment>
+		
+		<xsl:comment>
+Uninstallation Schema
+</xsl:comment>
+		
+		<xsl:element name="schema">
+			<xsl:attribute name="version">0.2</xsl:attribute>
+			
+			<xsl:apply-templates select="schema/table">
+				<xsl:sort select="position()" data-type="number" order="descending"/>
+			</xsl:apply-templates>
+		</xsl:element>
+	</xsl:template>
+	
+	<!-- Table -->
+	<xsl:template match="table">
+		<xsl:if test="count(DROP) = 0">
+			<xsl:element name="table">
+				<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
+				
+				<xsl:if test="string-length(@platform) > 0">
+					<xsl:attribute name="platform"><xsl:value-of select="@platform"/></xsl:attribute>
+				</xsl:if>
+				
+				<xsl:if test="string-length(@version) > 0">
+					<xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
+				</xsl:if>
+				
+				<xsl:apply-templates select="descr[1]"/>
+				
+				<xsl:element name="DROP"/>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+	
+	<!-- Description -->
+	<xsl:template match="descr">
+		<xsl:element name="descr">
+			<xsl:value-of select="normalize-space(text())"/>
+		</xsl:element>
+	</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file

Modified: plog/branches/plog-1.0.1/config/config.properties.php
===================================================================
--- plog/branches/plog-1.0.1/config/config.properties.php	2005-04-08 12:21:14 UTC (rev 1787)
+++ plog/branches/plog-1.0.1/config/config.properties.php	2005-04-08 19:43:46 UTC (rev 1788)
@@ -2,9 +2,9 @@
 #
 # database settings
 #
-$config["db_host"] = "";
-$config["db_username"] = "";
-$config["db_password"] = "";
-$config["db_database"] = "";
-$config["db_prefix"] = "";
-?>
+$config["db_host"] = "localhost";
+$config["db_username"] = "root";
+$config["db_password"] = "1796sz";
+$config["db_database"] = "plog_101";
+$config["db_prefix"] = "plog_";
+?>
\ No newline at end of file




More information about the pLog-svn mailing list