]> git.mjollnir.org Git - moodle.git/commitdiff
Updates to ADOdb 4.0.1 - some bug fixes
authormoodler <moodler>
Sat, 25 Oct 2003 05:59:58 +0000 (05:59 +0000)
committermoodler <moodler>
Sat, 25 Oct 2003 05:59:58 +0000 (05:59 +0000)
93 files changed:
lib/adodb/adodb-cryptsession.php
lib/adodb/adodb-csvlib.inc.php
lib/adodb/adodb-datadict.inc.php
lib/adodb/adodb-error.inc.php
lib/adodb/adodb-errorhandler.inc.php
lib/adodb/adodb-errorpear.inc.php
lib/adodb/adodb-lib.inc.php
lib/adodb/adodb-pager.inc.php
lib/adodb/adodb-pear.inc.php
lib/adodb/adodb-perf.inc.php
lib/adodb/adodb-session-clob.php
lib/adodb/adodb-session.php
lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png [new file with mode: 0644]
lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/stylesheet.css [new file with mode: 0644]
lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/_adodb-xmlschema_php.html [new file with mode: 0644]
lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/adoSchema.html [new file with mode: 0644]
lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/package_xmlschema.html [new file with mode: 0644]
lib/adodb/adodb.inc.php
lib/adodb/datadict/datadict-access.inc.php
lib/adodb/datadict/datadict-db2.inc.php
lib/adodb/datadict/datadict-generic.inc.php
lib/adodb/datadict/datadict-ibase.inc.php
lib/adodb/datadict/datadict-informix.inc.php
lib/adodb/datadict/datadict-mssql.inc.php
lib/adodb/datadict/datadict-mysql.inc.php
lib/adodb/datadict/datadict-oci8.inc.php
lib/adodb/datadict/datadict-postgres.inc.php
lib/adodb/datadict/datadict-sybase.inc.php
lib/adodb/docs-adodb.htm
lib/adodb/docs-datadict.htm
lib/adodb/docs-perf.htm [new file with mode: 0644]
lib/adodb/docs-session.htm
lib/adodb/drivers/adodb-access.inc.php
lib/adodb/drivers/adodb-ado.inc.php
lib/adodb/drivers/adodb-ado_access.inc.php
lib/adodb/drivers/adodb-ado_mssql.inc.php
lib/adodb/drivers/adodb-borland_ibase.inc.php
lib/adodb/drivers/adodb-csv.inc.php
lib/adodb/drivers/adodb-db2.inc.php
lib/adodb/drivers/adodb-fbsql.inc.php
lib/adodb/drivers/adodb-firebird.inc.php
lib/adodb/drivers/adodb-ibase.inc.php
lib/adodb/drivers/adodb-informix.inc.php
lib/adodb/drivers/adodb-informix72.inc.php
lib/adodb/drivers/adodb-mssql.inc.php
lib/adodb/drivers/adodb-mssqlpo.inc.php
lib/adodb/drivers/adodb-mysql.inc.php
lib/adodb/drivers/adodb-mysqlt.inc.php
lib/adodb/drivers/adodb-oci8.inc.php
lib/adodb/drivers/adodb-oci805.inc.php
lib/adodb/drivers/adodb-oci8po.inc.php
lib/adodb/drivers/adodb-odbc.inc.php
lib/adodb/drivers/adodb-odbc_mssql.inc.php
lib/adodb/drivers/adodb-odbc_oracle.inc.php
lib/adodb/drivers/adodb-oracle.inc.php
lib/adodb/drivers/adodb-postgres.inc.php
lib/adodb/drivers/adodb-postgres64.inc.php
lib/adodb/drivers/adodb-postgres7.inc.php
lib/adodb/drivers/adodb-proxy.inc.php
lib/adodb/drivers/adodb-sapdb.inc.php
lib/adodb/drivers/adodb-sqlanywhere.inc.php
lib/adodb/drivers/adodb-sqlite.inc.php
lib/adodb/drivers/adodb-sybase.inc.php
lib/adodb/drivers/adodb-vfp.inc.php
lib/adodb/perf/perf-db2.inc.php
lib/adodb/perf/perf-informix.inc.php
lib/adodb/perf/perf-mssql.inc.php
lib/adodb/perf/perf-mysql.inc.php
lib/adodb/perf/perf-oci8.inc.php
lib/adodb/perf/perf-postgres.inc.php
lib/adodb/pivottable.inc.php
lib/adodb/rsfilter.inc.php
lib/adodb/server.php
lib/adodb/tests/benchmark.php
lib/adodb/tests/client.php
lib/adodb/tests/test-datadict.php
lib/adodb/tests/test-xmlschema.php
lib/adodb/tests/test.php
lib/adodb/tests/test2.php
lib/adodb/tests/test3.php
lib/adodb/tests/test4.php
lib/adodb/tests/test5.php
lib/adodb/tests/testcache.php
lib/adodb/tests/testdatabases.inc.php
lib/adodb/tests/testgenid.php
lib/adodb/tests/testmssql.php
lib/adodb/tests/testoci8.php
lib/adodb/tests/testoci8cursor.php
lib/adodb/tests/testpaging.php
lib/adodb/tests/testpear.php
lib/adodb/tests/testsessions.php
lib/adodb/toexport.inc.php
lib/adodb/tohtml.inc.php

index fb6d2eae1622a02597db0601854fe6b24ca8d589..9292fad28d8c983bc38ec9a7068e845f98911da5 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 49dd3fb00319b38f9ef3d97a1abcfc62867c9137..ba59b6bcaa8b40d0e3af557e6898a8d0451a7b83 100644 (file)
@@ -3,7 +3,7 @@ global $ADODB_INCLUDED_CSV;
 $ADODB_INCLUDED_CSV = 1;\r
 \r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index 8eabbd54df087254766a2b584f2775076139d75d..0c73094f245ef2a07357d1c6fa4579fad4f46e70 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 088429f919121715c5b27c9894c1136346aa6da5..7ecd7bba755a9431901e66b8dde0d796254baea8 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index d726b1d1f1a7bd47793dfcb24e7680e6965ebc38..c0489c9ae2533af40006920b0a4c5d94529e9cc1 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /**\r
- * @version V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license.\r
   Whenever there is any discrepancy between the two licenses,\r
   the BSD license will take precedence.\r
index 61f255ad0a50526dc21279f7c8f9c0aab79d87c8..66dc2b839bc9503b6ac87d2bc5b16abee0fd8e8c 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 9d14434a821f08428825681bcd4800b169a4be38..7720ee1265624a8d9fc6c881d43bd7d193f2606d 100644 (file)
@@ -4,7 +4,7 @@ global $ADODB_INCLUDED_LIB;
 $ADODB_INCLUDED_LIB = 1;\r
 \r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index 152e00c0d937993d72d831a7f0b20842bccacffa..e96c5497d12078cf3b2c2644c70b891eaf2b9510 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-       V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+       V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
          Released under both BSD license and Lesser GPL library license. \r
          Whenever there is any discrepancy between the two licenses, \r
          the BSD license will take precedence. \r
        Please note, this class is entirely unsupported, \r
        and no free support requests except for bug reports\r
        will be entertained by the author.\r
-       \r
-       My company also sells a commercial pagination \r
-       object at http://phplens.com/ with much more \r
-       functionality, including search, create, edit,\r
-       delete records. \r
+\r
 */\r
 class ADODB_Pager {\r
        var $id;        // unique id for pager (defaults to 'adodb')\r
index 94e7033ee7805fb632e931ecb2bc65eeb7bbbc0f..fa272fc1aab6eee16f49564792838e6c54ac50da 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index e3e8d44d04ccbe61d74a9edf85b44a220fba3e1a..bedd98f8124b0c23ec16a2c49f7b1ceceaa06baf 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
@@ -39,6 +39,7 @@ global $HTTP_SERVER_VARS;
 \r
        if (!empty($conn->_logsql)) {\r
                $conn->_logsql = false; // disable logsql error simulation\r
+               $dbT = $conn->databaseType;\r
                \r
                $a0 = split(' ',$t0);\r
                $a0 = (float)$a0[1]+(float)$a0[0];\r
@@ -51,11 +52,14 @@ global $HTTP_SERVER_VARS;
                if (!$rs) {\r
                        $errM = $conn->ErrorMsg();\r
                        $errN = $conn->ErrorNo();\r
+                       $conn->lastInsID = 0;\r
                        $tracer = substr('ERROR: '.htmlspecialchars($errM),0,250);\r
                } else {\r
                        $tracer = '';\r
                        $errM = '';\r
                        $errN = 0;\r
+                       $conn->lastInsID = $conn->Insert_ID();\r
+               \r
                }\r
                if (isset($HTTP_SERVER_VARS['HTTP_HOST'])) {\r
                        $tracer .= '<br>'.$HTTP_SERVER_VARS['HTTP_HOST'];\r
@@ -83,7 +87,7 @@ global $HTTP_SERVER_VARS;
 \r
                $saved = $conn->debug;\r
                $conn->debug = 0;\r
-               $dbT = $conn->databaseType;\r
+               \r
                if ($conn->dataProvider == 'oci8' && $dbT != 'oci8po') {\r
                        $isql = "insert into adodb_logsql values($conn->sysTimeStamp,:b,:c,:d,:e,:f)";\r
                } else if ($dbT == 'odbc_mssql' || $dbT == 'informix') {\r
index a34cdbe19e784bb162b588927a60244b21bec454..e57162aa494c1c2786cbd5e370bf169a1bba14df 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-  V3.92  2 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 4a2aefdfb4ccecbebaa54ceb54f5d79116b63764..7c2d004e130632770d83dbfe96e4e312123c263b 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
diff --git a/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png b/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png
new file mode 100644 (file)
index 0000000..19fdf05
Binary files /dev/null and b/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/bg_left.png differ
diff --git a/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/stylesheet.css b/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/media/stylesheet.css
new file mode 100644 (file)
index 0000000..506c90f
--- /dev/null
@@ -0,0 +1,94 @@
+BODY, DIV, SPAN, PRE, CODE, TD, TH
+                                                                       {
+                                                                               line-height                             : 140%;
+                                                                               font-size                               : 10pt;
+                                                                       }
+
+A                                                                      {
+                                                                               text-decoration                 : none;
+                                                                       }
+
+A:link                                                         {
+                                                                               color                                   : #336699;
+                                                                       }
+
+A:visited                                                      {
+                                                                               color                                   : #003366;
+                                                                       }
+
+A:active, A:hover                                      {
+                                                                               color                                   : #6699CC;
+                                                                       }
+
+A:hover                                                                {
+                                                                               text-decoration                 : underline;
+                                                                       }
+
+SPAN.type                                                      {
+                                                                               color                                   : #336699;
+                                                                               font-size                               : xx-small;
+                                                                               font-weight                             : normal;
+                                                                       }
+
+PRE                                                                    {
+                                                                               background-color                : #EEEEEE;
+                                                                               padding                                 : 10px;
+                                                                               border-width                    : 1px;
+                                                                               border-color                    : #336699;
+                                                                               border-style                    : solid;
+                                                                       }
+
+HR                                                                     {
+                                                                               color                                   : #336699;
+                                                                               background-color                : #336699;
+                                                                               border-width                    : 0px;
+                                                                               height                                  : 1px;
+                                                                               filter                                  : Alpha (opacity=100,finishopacity=0,style=1);
+                                                                       }
+                                                                         
+DIV.sdesc                                                      {
+                                                                               font-weight                             : bold;
+                                                                               background-color                : #EEEEEE;
+                                                                               padding                                 : 10px;
+                                                                               border-width                    : 1px;
+                                                                               border-color                    : #336699;
+                                                                               border-style                    : solid;
+                                                                       }
+
+DIV.desc                                                       {
+                                                                               font-family                             : monospace;
+                                                                               background-color                : #EEEEEE;
+                                                                               padding                                 : 10px;
+                                                                               border-width                    : 1px;
+                                                                               border-color                    : #336699;
+                                                                               border-style                    : solid;
+                                                                       }
+
+SPAN.code                                                      {
+                                                                               font-family                             : monospace;
+                                                                       }
+
+CODE.varsummarydefault                         {
+                                                                               padding                                 : 1px;
+                                                                               border-width                    : 1px;
+                                                                               border-style                    : dashed;
+                                                                               border-color                    : #336699;
+                                                                       }
+
+UL.tute                                                                        {
+                                                                               margin:                 0px;
+                                                                               padding:                0px;
+                                                                               padding-left:           5px;
+                                                                       }
+
+LI.tute                                                                        {
+                                                                               line-height                             : 140%;
+                                                                               font-size                               : 10pt;
+                                                                               text-indent:            -15px;
+                                                                               padding-bottom:         2px;
+                                                                               padding-left:           14px;
+                                                                       }
+
+.small                                                         {
+                                                                               font-size                               : 9pt;
+                                                                       }
diff --git a/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/_adodb-xmlschema_php.html b/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/_adodb-xmlschema_php.html
new file mode 100644 (file)
index 0000000..d36aaa0
--- /dev/null
@@ -0,0 +1,111 @@
+<!--
+       IE 6 makes the page to wide with the following doctype. I accept
+       standards if they help me, not if they make anything even harder!
+//-->
+<!--<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN' 'http://www.w3.org/TR/REC-html40/loose.dtd'>//-->
+<!--NewPage-->
+<HTML>
+<HEAD>
+       <!-- Generated by PhpDoc date: 'Sat,  3 May 2003 13:13:37 -0400' -->
+       <TITLE>Docs for page adodb-xmlschema.php</TITLE>
+<LINK REL ='stylesheet' TYPE='text/css' HREF='../media/stylesheet.css' TITLE='Style'>
+</HEAD>
+<BODY BGCOLOR='white'>
+<a name="top"><!-- --></a><h3><SPAN class="type">File:</SPAN> Program_Root/adodb-xmlschema.php<HR>
+</h3>
+<!-- ========== Info from phpDoc block ========= -->
+<div class="sdesc">xmlschema is a class that allows the user to quickly and easily build a database on any ADOdb-supported platform using a simple XML schema.</div>
+<UL>
+               <LI><b>copyright:</b> <CODE>Copyright &copy; 2003 ars Cognita Inc., all rights reserved</CODE></LI>
+               <LI><b>version:</b> <CODE>$revision: $</CODE></LI>
+               <LI><b>author:</b> <CODE>Richard Tango-Lowy</CODE></LI>
+       </UL>
+Classes in this file:
+<dl>
+<dt></dt>
+       <dd>Creates a table object in ADOdb's datadict format</dd>
+<dt></dt>
+       <dd>Creates an index object in ADOdb's datadict format</dd>
+<dt></dt>
+       <dd>Creates the SQL to execute a list of provided SQL queries</dd>
+<dt><a href="../xmlschema/adoSchema.html">adoSchema</a></dt>
+       <dd>Loads and parses an XML file, creating an array of "ready-to-run" SQL statements</dd>
+</dl>
+<hr>
+<!-- =========== INCLUDE SUMMARY =========== -->
+<A NAME='include_summary'><!-- --></A>
+<H3>Include Statements Summary</H3>
+
+<UL>
+                       <LI><CODE><A HREF="#_adodb_inc_php">include</A></CODE> = <CODE class="varsummarydefault">"adodb.inc.php"</CODE>
+               <BR>Include the main ADODB library
+       </UL>
+<hr>
+<!-- =========== GLOBAL VARIABLE SUMMARY =========== -->
+<A NAME='global_summary'><!-- --></A>
+<H3>Global Variable Summary</H3>
+
+<UL>
+       </UL>
+
+<hr>
+<!-- =========== CONSTANT SUMMARY =========== -->
+<A NAME='constant_summary'><!-- --></A>
+<H3>Constant Summary</H3>
+
+<UL>
+       </UL>
+<hr>
+<!-- =========== FUNCTION SUMMARY =========== -->
+<A NAME='function_summary'><!-- --></A>
+<H3>Function Summary</H3> 
+
+<UL>
+       </UL>
+<hr>
+<!-- ============ INCLUDE DETAIL =========== -->
+
+<A NAME='include_detail'></A>
+<H3>Include Statements Detail</H3>
+
+<UL>
+                       <A NAME="_adodb_inc_php"><!-- --></A>
+               <LI><SPAN class="code">include file:</SPAN> = <CODE class="varsummarydefault">"adodb.inc.php"</CODE> [line <span class="linenumber">31</span>]<br />
+               <BR><BR>
+               <!-- ========== Info from phpDoc block ========= -->
+<div class="sdesc">Include the main ADODB library</div>
+<UL>
+       </UL>
+       </UL>
+<hr>
+<!-- ============ GLOBAL VARIABLE DETAIL =========== -->
+
+<A NAME='global_detail'></A>
+<H3>Global Variable Detail</H3>
+
+<UL>
+       </UL>
+<hr>
+<!-- ============ CONSTANT DETAIL =========== -->
+
+<A NAME='constant_detail'></A>
+<H3>Constant Detail</H3>
+
+<UL>
+       </UL>
+<hr>
+<!-- ============ FUNCTION DETAIL =========== -->
+
+<A NAME='function_detail'></A>
+<H3>Function Detail</H3>
+
+<UL>
+</UL>
+<hr>
+       <div id="credit">
+               <hr>
+               Documention generated on Sat,  3 May 2003 13:13:37 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0rc1</a>
+       </div>
+</body>
+</html>
+</HTML>
\ No newline at end of file
diff --git a/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/adoSchema.html b/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/adoSchema.html
new file mode 100644 (file)
index 0000000..055efcc
--- /dev/null
@@ -0,0 +1,235 @@
+<!--
+       IE 6 makes the page to wide with the following doctype. I accept
+       standards if they help me, not if they make anything even harder!
+//-->
+<!--<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN' 'http://www.w3.org/TR/REC-html40/loose.dtd'>//-->
+<!--NewPage-->
+<HTML>
+<HEAD>
+       <!-- Generated by PhpDoc date: 'Sat,  3 May 2003 13:13:37 -0400' -->
+       <TITLE>Docs For Class adoSchema</TITLE>
+<LINK REL ='stylesheet' TYPE='text/css' HREF='../media/stylesheet.css' TITLE='Style'>
+</HEAD>
+<BODY BGCOLOR='white'>
+<a name="top"><!-- --></a><!-- Start of Class Data -->
+<H3>
+       <SPAN class="type">Class</SPAN> adoSchema
+       <HR>
+</H3>
+[line <span class="linenumber">379</span>]<br />
+<pre>
+</pre>
+<SPAN class="type">Location:</SPAN> Program_Root/adodb-xmlschema.php
+<hr>
+<!-- ========== Info from phpDoc block ========= -->
+<div class="sdesc">Loads and parses an XML file, creating an array of "ready-to-run" SQL statements</div>
+<div class="desc"><p>This class is used to load and parse the XML file, to create an array of SQL statements that can be used to build a database, and to build the database using the SQL array.</p></div>
+<UL>
+       </UL>
+<hr>
+<!-- =========== VAR SUMMARY =========== -->
+<A NAME='var_summary'><!-- --></A>
+<H3>Class Variable Summary</H3>
+
+<UL>
+               <!-- =========== Summary =========== -->
+               <LI><CODE><a href="../xmlschema/adoSchema.html#var$dbconn">$dbconn</a></CODE> = <CODE class="varsummarydefault"></CODE>
+               <BR>
+               
+               <!-- =========== Summary =========== -->
+               <LI><CODE><a href="../xmlschema/adoSchema.html#var$dbType">$dbType</a></CODE> = <CODE class="varsummarydefault"></CODE>
+               <BR>
+               
+               <!-- =========== Summary =========== -->
+               <LI><CODE><a href="../xmlschema/adoSchema.html#var$dict">$dict</a></CODE> = <CODE class="varsummarydefault"></CODE>
+               <BR>
+               
+               <!-- =========== Summary =========== -->
+               <LI><CODE><a href="../xmlschema/adoSchema.html#var$sqlArray">$sqlArray</a></CODE> = <CODE class="varsummarydefault"></CODE>
+               <BR>
+               
+               <!-- =========== Summary =========== -->
+               <LI><CODE><a href="../xmlschema/adoSchema.html#var$xmlParser">$xmlParser</a></CODE> = <CODE class="varsummarydefault"></CODE>
+               <BR>
+               
+       </UL>
+<hr>
+<!-- =========== INHERITED VAR SUMMARY =========== -->
+<A NAME='inheritedvar_summary'><!-- --></A>
+<H3>Inherited Class Variable Summary</H3>
+
+
+<hr>
+<!-- =========== METHOD SUMMARY =========== -->
+<A NAME='method_summary'><!-- --></A>
+<H3>Method Summary</H3> 
+
+<UL>
+               <!-- =========== Summary =========== -->
+               <LI><CODE><A HREF='../xmlschema/adoSchema.html#methodadoSchema'>void adoSchema()</A></CODE>
+               <BR>Constructor.
+               <!-- =========== Summary =========== -->
+               <LI><CODE><A HREF='../xmlschema/adoSchema.html#methodDestroy'>void Destroy()</A></CODE>
+               <BR>Destructor
+               <!-- =========== Summary =========== -->
+               <LI><CODE><A HREF='../xmlschema/adoSchema.html#methodExecuteSchema'>integer ExecuteSchema()</A></CODE>
+               <BR>Loads a schema into the database
+               <!-- =========== Summary =========== -->
+               <LI><CODE><A HREF='../xmlschema/adoSchema.html#methodParseSchema'>array ParseSchema()</A></CODE>
+               <BR>Loads and parses an XML file
+       </UL>
+
+<!-- =========== INHERITED METHOD SUMMARY =========== -->
+<A NAME='methods_inherited'><!-- --></A>
+<H3>Inherited Method Summary</H3> 
+
+<hr>
+<!-- ============ METHOD DETAIL =========== -->
+
+<A NAME='method_detail'></A>
+<H3>Method Detail</H3>
+
+<UL>
+<A NAME='methodadoSchema'><!-- --></A>
+
+<LI><SPAN class="code">Constructor void adoSchema()</SPAN> [line <span class="linenumber">441</span>]
+<BR><BR>
+<SPAN class="type">Usage:</SPAN> <SPAN class="code">adoSchema(
+object
+$dbconn)</SPAN>
+<BR><BR>
+
+<!-- ========== Info from phpDoc block ========= -->
+<div class="sdesc">Constructor.</div>
+<div class="desc"><p>Initializes the xmlschema object</p></div>
+               <H4>Parameters</H4>
+       <UL>
+                       <LI><SPAN class="code">object $dbconn</SPAN> - ADOdb connection object
+               </UL>
+               
+       <H4>Info</H4>
+       <UL>
+               </UL>
+       <p class="top">[ <a href="#top">Top</a> ]</p>
+<BR>
+<A NAME='methodDestroy'><!-- --></A>
+
+<LI><SPAN class="code">void Destroy()</SPAN> [line <span class="linenumber">725</span>]
+<BR><BR>
+<SPAN class="type">Usage:</SPAN> <SPAN class="code">Destroy(
+)</SPAN>
+<BR><BR>
+
+<!-- ========== Info from phpDoc block ========= -->
+<div class="sdesc">Destructor</div>
+               
+       <H4>Info</H4>
+       <UL>
+               </UL>
+       <p class="top">[ <a href="#top">Top</a> ]</p>
+<BR>
+<A NAME='methodExecuteSchema'><!-- --></A>
+
+<LI><SPAN class="code">integer ExecuteSchema()</SPAN> [line <span class="linenumber">504</span>]
+<BR><BR>
+<SPAN class="type">Usage:</SPAN> <SPAN class="code">ExecuteSchema(
+array
+$sqlArray, [boolean
+$continueOnErr = TRUE])</SPAN>
+<BR><BR>
+
+<!-- ========== Info from phpDoc block ========= -->
+<div class="sdesc">Loads a schema into the database</div>
+<div class="desc"><p>Accepts an array of SQL queries generated by the parser  and executes them.</p></div>
+               <H4>Parameters</H4>
+       <UL>
+                       <LI><SPAN class="code">array $sqlArray</SPAN> - Array of SQL statements
+                       <LI><SPAN class="code">boolean $continueOnErr</SPAN> - Don't fail out if an error is encountered
+               </UL>
+               
+       <H4>Info</H4>
+       <UL>
+                       <LI><B>return</B>: <CODE>0 if failed, 1 if errors, 2 if successful</CODE>
+               </UL>
+       <p class="top">[ <a href="#top">Top</a> ]</p>
+<BR>
+<A NAME='methodParseSchema'><!-- --></A>
+
+<LI><SPAN class="code">array ParseSchema()</SPAN> [line <span class="linenumber">465</span>]
+<BR><BR>
+<SPAN class="type">Usage:</SPAN> <SPAN class="code">ParseSchema(
+string
+$file)</SPAN>
+<BR><BR>
+
+<!-- ========== Info from phpDoc block ========= -->
+<div class="sdesc">Loads and parses an XML file</div>
+<div class="desc"><p>This method accepts a path to an xmlschema-compliant XML file, loads it, parses it, and uses it to create the SQL to generate the objects described by the XML file.</p></div>
+               <H4>Parameters</H4>
+       <UL>
+                       <LI><SPAN class="code">string $file</SPAN> - XML file
+               </UL>
+               
+       <H4>Info</H4>
+       <UL>
+                       <LI><B>return</B>: <CODE>Array of SQL queries, ready to execute</CODE>
+               </UL>
+       <p class="top">[ <a href="#top">Top</a> ]</p>
+<BR>
+</UL>
+<hr>
+<!-- ============ VARIABLE DETAIL =========== -->
+
+<A NAME='variable_detail'></A>
+
+<H3>Variable Detail</H3>
+
+<UL>
+<A NAME="var$dbconn"><!-- --></A>
+<LI><SPAN class="code">$dbconn</SPAN> = <CODE class="varsummarydefault"></CODE> [line <span class="linenumber">394</span>]</LI>
+<LI><b>Data type:</b> <CODE class="varsummarydefault">ADOdb</CODE></LI>
+<!-- ========== Info from phpDoc block ========= -->
+<UL>
+               <LI><b>var:</b> <CODE>connection object</CODE></LI>
+       </UL>
+<BR>
+<A NAME="var$dbType"><!-- --></A>
+<LI><SPAN class="code">$dbType</SPAN> = <CODE class="varsummarydefault"></CODE> [line <span class="linenumber">399</span>]</LI>
+<LI><b>Data type:</b> <CODE class="varsummarydefault">string</CODE></LI>
+<!-- ========== Info from phpDoc block ========= -->
+<UL>
+               <LI><b>var:</b> <CODE>Database type (platform)</CODE></LI>
+       </UL>
+<BR>
+<A NAME="var$dict"><!-- --></A>
+<LI><SPAN class="code">$dict</SPAN> = <CODE class="varsummarydefault"></CODE> [line <span class="linenumber">404</span>]</LI>
+<LI><b>Data type:</b> <CODE class="varsummarydefault">ADOdb</CODE></LI>
+<!-- ========== Info from phpDoc block ========= -->
+<UL>
+               <LI><b>var:</b> <CODE>Data Dictionary</CODE></LI>
+       </UL>
+<BR>
+<A NAME="var$sqlArray"><!-- --></A>
+<LI><SPAN class="code">$sqlArray</SPAN> = <CODE class="varsummarydefault"></CODE> [line <span class="linenumber">384</span>]</LI>
+<LI><b>Data type:</b> <CODE class="varsummarydefault">array</CODE></LI>
+<!-- ========== Info from phpDoc block ========= -->
+<UL>
+               <LI><b>var:</b> <CODE>Array containing SQL queries to generate all objects</CODE></LI>
+       </UL>
+<BR>
+<A NAME="var$xmlParser"><!-- --></A>
+<LI><SPAN class="code">$xmlParser</SPAN> = <CODE class="varsummarydefault"></CODE> [line <span class="linenumber">389</span>]</LI>
+<LI><b>Data type:</b> <CODE class="varsummarydefault">XML</CODE></LI>
+<!-- ========== Info from phpDoc block ========= -->
+<UL>
+               <LI><b>var:</b> <CODE>Parser object</CODE></LI>
+       </UL>
+<BR>
+</UL>
+<hr>
+       <div id="credit">
+               <hr>
+               Documention generated on Sat,  3 May 2003 13:13:37 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.0rc1</a>
+       </div>
+</body>
+</html>
\ No newline at end of file
diff --git a/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/package_xmlschema.html b/lib/adodb/adodb-xmlschema-0.0.1-snap20030511/docs/xmlschema/package_xmlschema.html
new file mode 100644 (file)
index 0000000..3b434bf
--- /dev/null
@@ -0,0 +1,114 @@
+<H1>adodb-xmlschema</H1>
+<P>Written by <a href="mailto:richtl@arscognita.com">Richard Tango-Lowy</a>.</P>
+<P>For more information, contact <a href="richtl@arscognita.com">richtl@arscognita.com</a> 
+or visit our site at <a href="http://www.arscognita.com">www.arscognita.com</a>.</P>
+<P>At the moment, you should report bugs by mailing them to me. (If I can't convince John to
+make this part of ADODB :-), I'll  create a project for it on SourceForge.)
+
+<H2>Introduction</H2>
+<P><B>adodb-xmlschema</B> is a class that allows the user to quickly and easily
+build a database on any ADOdb-supported platform using a simple XML format.</P>
+<P>This library is dual-licensed under a BSD-style license and under the <B><a href="http://opensource.org/licenses/lgpl-license.php">GNU Lesser Public License</a></B>.
+See the <B>LICENSE</B> file for more information.</P>
+
+<H2>Features</H2><UL>
+       <LI>Darned easy to install
+       <LI>Quickly to create schemas that build on any platform supported by ADODB.</UL>
+
+<H2>Installation</H2>
+<P>To install adodb-xmlschema, simply copy the <tt>adodb-xmlschema.php</tt> file into your
+<B>ADODB</B> directory.</P>
+
+<H2>Quick Start</H2>
+<P>First, create an XML database schema. Let's call it "schema.xml:"</P><PRE>
+&lt;?xml version="1.0"?&gt;
+&lt;schema&gt;
+  &lt;table name="mytable"&gt;
+    &lt;field name="row1" type="I"&gt;
+      &lt;descr&gt;An integer row that's a primary key and autoincrements&lt;/descr&gt;
+      &lt;KEY/&gt;
+      &lt;AUTOINCREMENT/&gt;
+    &lt;/field&gt;
+    &lt;field name="row2" type="C" size="16"&gt;
+      &lt;descr&gt;A 16 character varchar row that can't be null&lt;/descr&gt;
+      &lt;NOTNULL/&gt;
+    &lt;/field&gt;
+  &lt;/table&gt;
+  &lt;index name="myindex" table="mytable"&gt;
+    &lt;col&gt;row1&lt;/col&gt;
+    &lt;col&gt;row2&lt;/col&gt;
+  &lt;/index&gt;
+  &lt;sql&gt;
+    &lt;descr&gt;SQL to be executed only on specific platforms&lt;/descr&gt;
+    &lt;query platform="postgres|postgres7"&gt;
+      insert into mytable ( row1, row2 ) values ( 12, 'stuff' )
+    &lt;/query&gt;
+    &lt;query platform="mysql"&gt;
+      insert into mytable ( row1, row2 ) values ( 12, 'different stuff' )
+    &lt;/query&gt;
+  &lt;/sql&gt;
+&lt;/schema&gt;
+</PRE><P>Create a new database using the appropriate tool for your platform.
+Executing the following PHP code will create the a <i>mytable</i> and <i>myindex</i>
+in the database and insert two rows into <i>mytable</i>. </P><PRE>                             
+// To build the schema, start by creating a normal ADOdb connection:
+$db->NewADOConnection( 'mysql' );
+$db->Connect( ... );
+
+// Create the schema object and build the query array.
+$schema = <B>new adoSchema</B>( $db );
+
+// Build the SQL array
+$sql = $schema-><B>ParseSchema</B>( "schema.xml" );
+
+// Execute the SQL on the database
+$result = $schema-><B>ExecuteSchema</B>( $sql );
+
+// Finally, clean up after the XML parser
+// (PHP won't do this for you!)
+$schema-><B>Destroy</B>();
+</PRE>
+       
+<H2>XML Schema Format:</H2>
+<P>(See <a href="../xmlschema.dtd">ADOdb_schema.dtd</a> for the full specification)</P>
+<PRE>
+&lt;?xml version="1.0"?&gt;
+&lt;schema&gt;
+  &lt;table name="tablename" platform="platform1|platform2|..."&gt;
+    &lt;descr&gt;Optional description&lt;/descr&gt;
+    &lt;field name="fieldname" type="datadict_type" size="size"&gt;
+      &lt;KEY/&gt;
+      &lt;NOTNULL/&gt;
+      &lt;AUTOINCREMENT/&gt;
+      &lt;DEFAULT value="value"/&gt;
+    &lt;/field&gt;
+       ... <i>more fields</i>
+  &lt;/table&gt;
+  ... <i>more tables</i>
+  
+  &lt;index name="indexname" platform="platform1|platform2|..."&gt;
+    &lt;descr&gt;Optional description&lt;/descr&gt;
+    &lt;col&gt;fieldname&lt;/col&gt;
+    ... <i>more columns</i>
+  &lt;/index&gt;
+  ... <i>more indices</i>
+  
+  &lt;sql platform="platform1|platform2|..."&gt;
+    &lt;descr&gt;Optional description&lt;/descr&gt;
+    &lt;query platform="platform1|platform2|..."&gt;SQL query&lt;/query&gt;
+    ... <i>more queries</i>
+  &lt;/sql&gt;
+  ... <i>more SQL</i>
+  &lt;/schema&gt;
+</PRE>
+<HR>
+<H2>Thanks</H2>
+<P>Thanks to John Lim for giving us ADODB, and for the hard work that keeps it on top of things. 
+And particulary for the datadict code that made xmlschema possible.</P>
+<P>And to the kind folks at <a href="http://phpdoc.org">PHP Documentor</a>. Cool tool.</P>
+<P>And to Linus. I thought the end of Amiga was the end of computing. Guess I was wrong :-)</P>
+<HR>
+<address>If you have any questions or comments, please email them to me  at 
+<a href="mailto:richtl@arscognita.com">richtl@arscognita.com</a>.</address>
+
+<P><TT>$Id$</TT></P>
\ No newline at end of file
index b43546eb0b72b6cadab03824410fddcd1a118193..4f40b6a2af456411e2d93ed704c1288e2ce7b84f 100644 (file)
@@ -14,7 +14,7 @@
 /**\r
        \mainpage       \r
        \r
-        @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim\@natsoft.com.my). All rights reserved.\r
+        @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim\@natsoft.com.my). All rights reserved.\r
 \r
        Released under both BSD license and Lesser GPL library license. You can choose which license\r
        you prefer.\r
                /**\r
                 * ADODB version as a string.\r
                 */\r
-               $ADODB_vers = 'V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';\r
+               $ADODB_vers = 'V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';\r
        \r
                /**\r
                 * Determines whether recordset->RecordCount() is used. \r
        var $metaTablesSQL = '';\r
        var $uniqueOrderBy = false; /// All order by columns have to be unique\r
        var $emptyDate = '&nbsp;';\r
+       var $emptyTimeStamp = '&nbsp;';\r
+       var $lastInsID = false;\r
        //--\r
        var $hasInsertID = false;               /// supports autoincrement ID?\r
        var $hasAffectedRows = false;   /// supports affected rows for update/delete?\r
                                if (!$array_2d) $inputarr = array($inputarr);\r
                                while(list(,$arr) = each($inputarr)) {\r
                                        $sql = ''; $i = 0;\r
-                                       foreach($arr as $v) {\r
+                                       reset($arr);\r
+                                       while(list(,$v) = each($arr)) {\r
                                                $sql .= $sqlarr[$i];\r
                                                // from Ron Baldwin <ron.baldwin@sourceprose.com>\r
                                                // Only quote string types      \r
         */ \r
                function Insert_ID()\r
                {\r
-                               if ($this->hasInsertID) return $this->_insertid();\r
-                               if ($this->debug) ADOConnection::outp( '<p>Insert_ID error</p>');\r
-                               return false;\r
+                       if ($this->_logsql && $this->lastInsID) return $this->lastInsID;\r
+                       if ($this->hasInsertID) return $this->_insertid();\r
+                       if ($this->debug) ADOConnection::outp( '<p>Insert_ID error</p>');\r
+                       return false;\r
                }\r
        \r
        \r
        function UnixTimeStamp($v)\r
        {\r
                if (!preg_match( \r
-                       "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ ,-]+(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", \r
+                       "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ ,-]*(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", \r
                        ($v), $rr)) return false;\r
                        \r
                if ($rr[1] <= TIMESTAMP_FIRST_YEAR && $rr[2]<= 1) return 0;\r
        \r
        }\r
        \r
+               /**\r
+        *\r
+        * @param v     is the character timestamp in YYYY-MM-DD hh:mm:ss format\r
+        * @param fmt   is the format to apply to it, using date()\r
+        *\r
+        * @return a timestamp formated as user desires\r
+        */\r
+       function UserTimeStamp($v,$fmt='Y-m-d H:i:s')\r
+       {\r
+               if (is_numeric($v)) return adodb_date($fmt,$v);\r
+               $tt = $this->UnixTimeStamp($v);\r
+               // $tt == -1 if pre TIMESTAMP_FIRST_YEAR\r
+               if (($tt === false || $tt == -1) && $v != false) return $v;\r
+               if ($tt == 0) return $this->emptyTimeStamp;\r
+               return adodb_date($fmt,$tt);\r
+       }\r
+       \r
        \r
        /**\r
         * Correctly quotes a string so that all strings are escaped. We prefix and append\r
         */\r
        function UserTimeStamp($v,$fmt='Y-m-d H:i:s')\r
        {\r
+               if (is_numeric($v)) return adodb_date($fmt,$v);\r
                $tt = $this->UnixTimeStamp($v);\r
                // $tt == -1 if pre TIMESTAMP_FIRST_YEAR\r
                if (($tt === false || $tt == -1) && $v != false) return $v;\r
-               if ($tt == 0) return $this->emptyTimeStamp;\r
+               if ($tt === 0) return $this->emptyTimeStamp;\r
                return adodb_date($fmt,$tt);\r
        }\r
        \r
        {\r
                \r
                if (!preg_match( \r
-                       "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ ,-]+(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", \r
+                       "|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ ,-]*(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|", \r
                        ($v), $rr)) return false;\r
                if ($rr[1] <= TIMESTAMP_FIRST_YEAR && $rr[2]<= 1) return 0;\r
        \r
                }\r
                \r
                $record = array();\r
-               foreach($this->bind as $k => $v) {\r
+               reset($this->bind);\r
+               while(list($k,$v) = each($this->bind)) {\r
+               //echo " $k $v, ";\r
+               //foreach($this->bind as $k => $v) {\r
                        $record[$k] = $this->fields[$v];\r
                }\r
 \r
index dc3f0abd0052a88d14a4b6bd06ab36b426b2b75e..39ba17da1ef48f8529ecc846630c9bba20f095e4 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 89fa96a4ef4b167e744a71e52071cbe63e51e3db..bffca670185049ef1cb4ab99d4e67f47fa294bf8 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 0e3c63b49acb8d5f797684d7cf102be032267e31..9f2f116b039bb1e88d4d11603b52087dc7619020 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 3b6e12bd9955e414997c3e55fd0deeb904c1f0b1..86b0be1dcd2de2308d98729c5ab03e0606dd8715 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index aa672791a843af67c9892d270703a3a6803f8e59..d051e566c3eb355b1847b0b429e466bd9af87f8d 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 63bb29f0926e8290f8e605507f8eb8b66924e810..cfe413580bbfdabaa9d6ef0874fbdb8fb9b8309d 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 48b7bda3f0def5af6e533766fec638e5ead0a6f9..068821a5c742694e0a22678b6812d83e76ee4370 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
@@ -133,6 +133,7 @@ class ADODB2_mysql extends ADODB_DataDict {
        function _IndexSQL($idxname, $tabname, $flds, $idxoptions)\r
        {\r
                //if (isset($idxoptions['REPLACE'])) $sql[] = "DROP INDEX IF EXISTS $idxname";\r
+               if (isset($idxoptions['REPLACE'])) $sql[] = "DROP INDEX $idxname ON $tabname";\r
                if (isset($idxoptions['FULLTEXT'])) $unique = ' FULLTEXT';\r
                else if (isset($idxoptions['UNIQUE'])) $unique = ' UNIQUE';\r
                else $unique = '';\r
index 4f8b941ff97c38e2bff9b4bfa8b84bed3938d3f4..17d71e12eca1b7bd1950c32390588f82d6602541 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 386ade080ab8fc2df094774801f4fd27a8100604..89914501a8f12d0f9e218b1d5cf8106c4011cc14 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 231b504ffed7ebcd2e9874196db5e27b0577ccdd..053581216280174e83659963b84d5772a7ce875e 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /**\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 8f737d177c6cd78356252922590b4ed3d295639c..ed41f28f89964c732e814ff1ac60dfe18494c3b8 100644 (file)
@@ -11,7 +11,7 @@
 <body bgcolor="#FFFFFF">\r
 \r
 <h2>ADOdb Library for PHP</h2>\r
-<p>V4.00 20 Oct 2003 (c) 2000-2003 John Lim (<a href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>)</p>\r
+<p>V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim#natsoft.com)</p>\r
 <p><font size="1">This software is dual licensed using BSD-Style and LGPL. This \r
   means you can use it in compiled proprietary and commercial products.</font></p>\r
        <p>Useful ADOdb links:  <a href=http://php.weblogs.com/adodb>Download</a> &nbsp; <a href=http://php.weblogs.com/adodb_manual>Other Docs</a>\r
@@ -65,7 +65,7 @@
   &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#executecursor">ExecuteCursor</a> \r
   (oci8 only)<br>\r
   Generates SQL strings: <a href="#getupdatesql">GetUpdateSQL</a> <a href="#getinsertsql">GetInsertSQL</a> \r
-  <a href="#ifnull">IfNull</a> <a href="#concat">Concat</a> <a href="#qstr"></a><a href="#param">Param</a> \r
+  <a href="#concat">Concat</a> <a href="#ifnull">IfNull</a> <a href="#substr">substr</a> <a href="#qstr"></a><a href="#param">Param</a> \r
   <a href="#prepare"></a><a href="#OffsetDate">OffsetDate</a> <a href="#SQLDate">SQLDate</a> \r
   <a href="#dbdate">DBDate</a> <a href="#dbtimestamp"></a> <a href="#dbtimestamp">DBTimeStamp</a><br>\r
   Blobs: <a href="#updateblob">UpdateBlob</a> <a href="#updateclob">UpdateClob</a> \r
@@ -78,7 +78,7 @@
   <a href="#begintrans">BeginTrans</a> <a href="#committrans">CommitTrans</a> \r
   <a href="#rollbacktrans">RollbackTrans</a> <br>\r
   Fetching Data: </font> <font size="2"><a href="#setfetchmode">SetFetchMode</a><br>\r
-  Strings: <a href="#concat">concat</a> <a href="#qstr">qstr</a> <a href="#quote">quote</a><br>\r
+  Strings: <a href="#concat">concat</a> <a href="#qstr">qstr</a> <a href="#quote">quote</a> <a href="#substr">substr</a><br>\r
   Dates: <a href="#dbdate">DBDate</a> <a href="#dbtimestamp">DBTimeStamp</a> <a href="#unixdate">UnixDate</a> \r
   <a href="#unixtimestamp">UnixTimeStamp</a> <a href="#OffsetDate">OffsetDate</a> \r
   <a href="#SQLDate">SQLDate</a> <br>\r
   </font><font size="2">Deprecated: <a href="#bind">Bind</a> <a href="#blankrecordset">BlankRecordSet</a></font><br>\r
   <a href="#adorecordSet"><b><br>\r
   ADORecordSet</b></a><br>\r
-  <font size="2">Returns one row:<a href="#fetchrow">FetchRow</a> <a href="#fetchinto">FetchInto</a> \r
+  <font size="2">\r
+  Returns one field: <a href="#fields">Fields</a><br>\r
+ Returns one row:<a href="#fetchrow">FetchRow</a> <a href="#fetchinto">FetchInto</a> \r
   <a href="#fetchobject">FetchObject</a> <a href="#fetchnextobject">FetchNextObject</a> \r
-  <a href="#fetchobj">FetchObj</a> <a href="#fetchnextobj">FetchNextObj</a><br>\r
+  <a href="#fetchobj">FetchObj</a> <a href="#fetchnextobj">FetchNextObj</a>\r
+ <a href="#getrowassoc">GetRowAssoc</a> <br>\r
   Returns all rows:<a href="#getarray">GetArray</a> <a href="#getrows">GetRows</a> \r
   <a href="#getassoc">GetAssoc</a><br>\r
   Scrolling:<a href="#move">Move</a> <a href="#movenext">MoveNext</a> <a href="#movefirst">MoveFirst</a> \r
   <a href="#nextrecordset">NextRecordSet</a><br>\r
   Field Info:<a href="#fieldcount">FieldCount</a> <a href="#fetchfield">FetchField</a> \r
   <a href="#metatype">MetaType</a><br>\r
-  Cleanup: <a href="#rsclose">Close</a></font> <font size="2"><br>\r
-  Deprecated: <a href="#getrowassoc">GetRowAssoc</a> <a href="#fields">Fields</a></font> \r
+  Cleanup: <a href="#rsclose">Close</a></font> <font size="2"></font> \r
 <p><font size="2"><a href="#rs2html"><b>rs2html</b></a>&nbsp; <a href="#exrs2html">example</a></font><br>\r
   <a href="#adodiff">Differences between ADOdb and ADO</a><br>\r
   <a href="#driverguide"><b>Database Driver Guide<br>\r
@@ -2057,6 +2059,15 @@ for ($i=0; $i &lt; $max; $i++)<br></font>        $DB-&gt;<font color="#000000">Execute(
   the function that checks whether a $field is null for the given database, and \r
   if null, change the value returned to $nullReplacementValue. Eg.</p>\r
 <pre>$sql = <font color="#993300">'SELECT '</font>.$db-&gt;IfNull('name', <font color="#993300">&quot;'- unknown -'&quot;</font>).<font color="#993300"> ' FROM table'</font>;</pre>\r
+<p><b>substr<a name="substr"></a></b></p>\r
+<p>This is not a function, but a property. Some databases have "substr" and others "substring"\r
+as the function to retrieve a sub-string. To use this property:\r
+<pre>\r
+  $sql = <font color="#993300">"SELECT "</font>.$db->substr.<font color="#993300">"(field, $offset, $length) from table"</font>;\r
+  $rs = $db->Execute($sql);\r
+</pre>\r
+<p>For all databases, the 1st parameter of <i>substr</i> is the field, the 2nd is the\r
+offset (1-based) to the beginning of the sub-string, and the 3rd is the length of the sub-string.\r
 <p><b>Param<a name="param"></a>($name )</b></p>\r
 <p>Generates a bind placeholder portably. For most databases, the bind placeholder \r
   is "?". However some databases use named bind parameters such as Oracle, eg \r
@@ -2525,8 +2536,6 @@ if ($rs)
 <p>Internally calls Move(RecordCount()-1). Note that some databases do not support \r
   this function.</p>\r
 <p><b>GetRowAssoc</b><a name="getrowassoc"></a>($toUpper=true)</p>\r
-<p>The above function is no longer the prefered way of getting associative arrays. \r
-  Use the <a href=#adodb_fetch_mode>$ADODB_FETCH_MODE</a> variable instead. </p>\r
 <p>Returns an associative array containing the current row. The keys to the array \r
   are the column names. The column names are upper-cased for easy access. To get \r
   the next row, you will still need to call MoveNext(). </p>\r
@@ -2548,12 +2557,9 @@ if ($rs)
 <p>Returns true if at last page (1-based). Requires PageExecute()/CachePageExecute() \r
   to be called. See <a href=#ex8>Example 8</a>.</p>\r
 <p><b>Fields</b><a name="fields"></a>(<b>$colname</b>)</p>\r
-<p>This function is deprecated. Use <a href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a> \r
-  instead. </p>\r
-<p>Some database extensions (eg. MySQL) return arrays that are both associative \r
-  and indexed if you use the native extensions. GetRowAssoc() does not return \r
-  arrays that combine associative and indexed elements. Returns the value of the \r
+<p>Returns the value of the \r
   associated column $<b>colname</b> for the current row. The column name is case-insensitive.</p>\r
+<p>This is a convenience function. For higher performance, use <a href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a>. </p>\r
 <p><b>FetchRow</b><a name="fetchrow"></a>()</p>\r
 </font> \r
 <p><font color="#000000">Returns array containing current row, or false if EOF. \r
@@ -2777,7 +2783,13 @@ $<font color="#663300">rs</font>   = $<font color="#663300">conn</font>->Execute
   PHP</a>. </p>\r
 </font> \r
 <h2>Change Log<a name="Changes"></a><a name="changelog"></a></h2>\r
-<p><b>4.00 ?? 2003 </b>\r
+<p><b>4.01 23 Oct 2003 </b>\r
+<p>Informix ErrorNo() fixed.\r
+<p>Modified PostgreSQL _fixblobs to use list/each instead of foreach.\r
+<p>Modified several places to use list/each, including GetRowAssoc().\r
+<p>Fixed insert_id() incorrectly generated when logsql() enabled.\r
+<p>Added UserTimeStamp() to connection class.\r
+<p><b>4.00 20 Oct 2003 </b>\r
 <p>Upgraded adodb-xmlschema to 1 Oct 2003 snapshot.\r
 <p>Fix to rs2html warning message. Thx to Filo.\r
 <p>Fix for odbc_mssql/mssql SQLDate(), hours was wrong.\r
@@ -2918,247 +2930,6 @@ which call sql, etc.
 <p>ChangeTableSQL contributed by Florian Buzin. \r
 <p>The odbc_mssql driver now sets CONCAT_NULL_YIELDS_NULL OFF for compat with \r
   mssql driver. \r
-<p><b>3.50 19 May 2003</b></p>\r
-<p>Fixed mssql compat with FreeTDS. FreeTDS does not implement mssql_fetch_assoc(). \r
-<p>Merged back connection and recordset code into adodb.inc.php. \r
-<p>ADOdb sessions using oracle clobs contributed by achim.gosse#ddd.de. See adodb-session-clob.php. \r
-<p>Added /s modifier to preg_match everywhere, which ensures that regex does not \r
-  stop at /n. Thx Pao-Hsi Huang. \r
-<p>Fixed error in metacolumns() for mssql. \r
-<p>Added time format support for SQLDate. \r
-<p>Image => B added to metatype. \r
-<p>MetaType now checks empty($this->blobSize) instead of empty($this). \r
-<p>Datadict has beta support for informix, sybase (mapped to mssql), db2 and generic \r
-  (which is a fudge). \r
-<p>BlobEncode for postgresql uses pg_escape_bytea, if available. Needed for compat \r
-  with 7.3. \r
-<p>Added $ADODB_LANG, to support multiple languages in MetaErrorMsg(). \r
-<p>Datadict can now parse table definition as declarative text. \r
-<p>For DataDict, oci8 autoincrement trigger missing semi-colon. Fixed. \r
-<p>For DataDict, when REPLACE flag enabled, drop sequence in datadict for autoincrement \r
-  field in postgres and oci8.s \r
-<p>Postgresql defaults to template1 database if no database defined in connect/pconnect. \r
-<p>We now clear _resultid in postgresql if query fails. \r
-<p><b>3.40 19 May 2003</b></p>\r
-<p>Added insert_id for odbc_mssql. \r
-<p>Modified postgresql UpdateBlobFile() because it did not work in safe mode. \r
-<p>Now connection object is passed to raiseErrorFn as last parameter. Needed by \r
-  StartTrans(). \r
-<p>Added StartTrans() and CompleteTrans(). It is recommended that you do not modify \r
-  transOff, but use the above functions. \r
-<p>oci8po now obeys ADODB_ASSOC_CASE settings. \r
-<p>Added virtualized error codes, using PEAR DB equivalents. Requires you to manually \r
-  include adodb-error.inc.php yourself, with MetaError() and MetaErrorMsg($errno). \r
-<p>GetRowAssoc for mysql and pgsql were flawed. Fix by Ross Smith. \r
-<p>Added to datadict types I1, I2, I4 and I8. Changed datadict type 'T' to map \r
-  to timestamp instead of datetime for postgresql. \r
-<p>Error handling in ExecuteSQLArray(), adodb-datadict.inc.php did not work. \r
-<p>We now auto-quote postgresql connection parameters when building connection \r
-  string. \r
-<p>Added session expiry notification. \r
-<p>We now test with odbc mysql - made some changes to odbc recordset constructor. \r
-<p>MetaColumns now special cases access and other databases for odbc. \r
-<p><b>3.31 17 March 2003</b></p>\r
-<p>Added row checking for _fetch in postgres. \r
-<p>Added Interval type to MetaType for postgres. \r
-<p>Remapped postgres driver to call postgres7 driver internally. \r
-<p>Adorecordset_array::getarray() did not return array when nRows >= 0. \r
-<p>Postgresql: at times, no error message returned by pg_result_error() but error \r
-  message returned in pg_last_error(). Recoded again. \r
-<p>Interbase blob's now use chunking for updateblob. \r
-<p>Move() did not set EOF correctly. Reported by Jorma T. \r
-<p>We properly support mysql timestamp fields when we are creating mysql tables \r
-  using the data-dict interface. \r
-<p>Table regex includes backticks character now. \r
-<p><b>3.30 3 March 2003</b></p>\r
-<p>Added $ADODB_EXTENSION and $ADODB_COMPAT_FETCH constant. \r
-<p>Made blank1stItem configurable using syntax "value:text" in GetMenu/GetMenu2. \r
-  Thx to Gabriel Birke. \r
-<p>Previously ADOdb differed from the Microsoft standard because it did not define \r
-  what to set $this->fields when EOF was reached. Now at EOF, ADOdb sets $this->fields \r
-  to false for all databases, which is consist with Microsoft's implementation. \r
-  Postgresql and mysql have always worked this way (in 3.11 and earlier). If you \r
-  are experiencing compatibility problems (and you are not using postgresql nor \r
-  mysql) on upgrading to 3.30, try setting the global variables $ADODB_COUNTRECS \r
-  = true (which is the default) and $ADODB_FETCH_COMPAT = true (this is a new \r
-  global variable). \r
-<p>We now check both pg_result_error and pg_last_error as sometimes pg_result_error \r
-  does not display anything. Iman Mayes \r
-<p> We no longer check for magic quotes gpc in Quote(). \r
-<p> Misc fixes for table creation in adodb-datadict.inc.php. Thx to iamsure. \r
-<p> Time calculations use adodb_time library for all negative timestamps due to \r
-  problems in Red Hat 7.3 or later. Formerly, only did this for Windows. \r
-<p> In mssqlpo, we now check if $sql in _query is a string before we change || \r
-  to +. This is to support prepared stmts. \r
-<p> Move() and MoveLast() internals changed to support to support EOF and $this->fields \r
-  change. \r
-<p> Added ADODB_FETCH_BOTH support to mssql. Thx to Angel Fradejas afradejas#mediafusion.es \r
-<p> We now check if link resource exists before we run mysql_escape_string in \r
-  qstr(). \r
-<p> Before we flock in csv code, we check that it is not a http url. \r
-<p><b>3.20 17 Feb 2003</b></p>\r
-<p>Added new Data Dictionary classes for creating tables and indexes. Warning \r
-  - this is very much alpha quality code. The API can still change. See adodb/tests/test-datadict.php \r
-  for more info. \r
-<p>We now ignore $ADODB_COUNTRECS for mysql, because PHP truncates incomplete \r
-  recordsets when mysql_unbuffered_query() is called a second time. \r
-<p>Now postgresql works correctly when $ADODB_COUNTRECS = false. \r
-<p>Changed _adodb_getcount to properly support SELECT DISTINCT. \r
-<p>Discovered that $ADODB_COUNTRECS=true has some problems with prepared queries \r
-  - suspect PHP bug. \r
-<p>Now GetOne and GetRow run in $ADODB_COUNTRECS=false mode for better performance. \r
-<p>Added support for mysql_real_escape_string() and pg_escape_string() in qstr(). \r
-<p>Added an intermediate variable for mysql _fetch() and MoveNext() to store fields, \r
-  to prevent overwriting field array with boolean when mysql_fetch_array() returns \r
-  false. \r
-<p>Made arrays for getinsertsql and getupdatesql case-insensitive. Suggested by \r
-  Tim Uckun" tim#diligence.com \r
-<p><b>3.11 11 Feb 2003</b></p>\r
-<p>Added check for ADODB_NEVER_PERSIST constant in PConnect(). If defined, then \r
-  PConnect() will actually call non-persistent Connect(). \r
-<p>Modified interbase to properly work with Prepare(). \r
-<p>Added $this->ibase_timefmt to allow you to change the date and time format. \r
-<p>Added support for $input_array parameter in CacheFlush(). \r
-<p>Added experimental support for dbx, which was then removed when i found that \r
-  it was slower than using native calls. \r
-<p>Added MetaPrimaryKeys for mssql and ibase/firebird. \r
-<p>Added new $trim parameter to GetCol and CacheGetCol \r
-<p>Uses updated adodb-time.inc.php 0.06. \r
-<p><b>3.10 27 Jan 2003</b> \r
-<p>Added adodb_date(), adodb_getdate(), adodb_mktime() and adodb-time.inc.php. \r
-<p>For interbase, added code to handle unlimited number of bind parameters. From \r
-  Daniel Hasan daniel#hasan.cl. \r
-<p>Added BlobDecode and UpdateBlob for informix. Thx to Fernando Ortiz. \r
-<p>Added constant ADODB_WINDOWS. If defined, means that running on Windows. \r
-<p>Added constant ADODB_PHPVER which stores php version as a hex num. Removed \r
-  $ADODB_PHPVER variable. \r
-<p>Felho Bacsi reported a minor white-space regular expression problem in GetInsertSQL. \r
-<p>Modified ADO to use variant to store _affectedRows \r
-<p>Changed ibase to use base class Replace(). Modified base class Replace() to \r
-  support ibase. \r
-<p>Changed odbc to auto-detect when 0 records returned is wrong due to bad odbc \r
-  drivers. \r
-<p>Changed mssql to use datetimeconvert ini setting only when 4.30 or later (does \r
-  not work in 4.23). \r
-<p>ExecuteCursor($stmt, $cursorname, $params) now accepts a new $params array \r
-  of additional bind parameters -- William Lovaton walovaton#yahoo.com.mx. \r
-<p>Added support for sybase_unbuffered_query if ADODB_COUNTRECS == false. Thx \r
-  to chuck may. \r
-<p>Fixed FetchNextObj() bug. Thx to Jorma Tuomainen. \r
-<p>We now use SCOPE_IDENTITY() instead of @@IDENTITY for mssql - thx to marchesini#eside.it \r
-<p>Changed postgresql movenext logic to prevent illegal row number from being \r
-  passed to pg_fetch_array(). \r
-<p>Postgresql initrs bug found by "Bogdan RIPA" bripa#interakt.ro $f1 accidentally \r
-  named $f \r
-<p><b>3.00 6 Jan 2003</b> \r
-<p>Fixed adodb-pear.inc.php syntax error. \r
-<p>Improved _adodb_getcount() to use SELECT COUNT(*) FROM ($sql) for languages \r
-  that accept it. \r
-<p>Fixed _adodb_getcount() caching error. \r
-<p>Added sql to retrive table and column info for odbc_mssql. \r
-<p><strong>2.91 3 Jan 2003</strong> \r
-<p>Revised PHP version checking to use $ADODB_PHPVER with legal values 0x4000, \r
-  0x4050, 0x4200, 0x4300. \r
-<p>Added support for bytea fields and oid blobs in postgres by allowing BlobDecode() \r
-  to detect and convert non-oid fields. Also added BlobEncode to postgres when \r
-  you want to encode oid blobs. \r
-<p>Added blobEncodeType property for connections to inform phpLens what encoding \r
-  method to use for blobs. \r
-<p>Added BlobDecode() and BlobEncode() to base ADOConnection class. \r
-<p>Added umask() to _gencachename() when creating directories. \r
-<p>Added charPage for ado drivers, so you can set the code page. \r
-<pre>\r
-$conn->charPage = CP_UTF8;\r
-$conn->Connect($dsn);\r
-</pre>\r
-<p>Modified _seek in mysql to check for num rows=0. \r
-<p>Added to metatypes new informix types for IDS 9.30. Thx Fernando Ortiz. \r
-<p>_maxrecordcount returned in CachePageExecute $rsreturn \r
-<p>Fixed sybase cacheselectlimit( ) problems \r
-<p>MetaColumns() max_length should use precision for types X and C for ms access. \r
-  Fixed. \r
-<p>Speedup of odbc non-SELECT sql statements. \r
-<p>Added support in MetaColumns for Wide Char types for ODBC. We halve max_length \r
-  if unicode/wide char. \r
-<p>Added 'B' to types handled by GetUpdateSQL/GetInsertSQL. \r
-<p>Fixed warning message in oci8 driver with $persist variable when using PConnect. \r
-<p><b>2.90 11 Dec 2002</b> \r
-<p>Mssql and mssqlpo and oci8po now support ADODB_ASSOC_CASE. \r
-<p>Now MetaType() can accept a field object as the first parameter. \r
-<p>New $arr = $db-&gt;ServerInfo( ) function. Returns $arr['description'] which \r
-  is the string description, and $arr['version']. \r
-<p>PostgreSQL and MSSQL speedups for insert/updates. \r
-<p> Implemented new SetFetchMode() that removes the need to use $ADODB_FETCH_MODE. \r
-  Each connection has independant fetchMode. \r
-<p>ADODB_ASSOC_CASE now defaults to 2, use native defaults. This is because we \r
-  would break backward compat for too many applications otherwise. \r
-<p>Patched encrypted sessions to use replace() \r
-<p>The qstr function supports quoting of nulls when escape character is \ \r
-<p>Rewrote bits and pieces of session code to check for time synch and improve \r
-  reliability. \r
-<p>Added property ADOConnection::hasTransactions = true/false; \r
-<p>Added CreateSequence and DropSequence functions \r
-<p>Found misplaced MoveNext() in adodb-postgres.inc.php. Fixed. \r
-<p>Sybase SelectLimit not reliable because 'set rowcount' not cached - fixed. \r
-<p>Moved ADOConnection to adodb-connection.inc.php and ADORecordSet to adodb-recordset.inc.php. \r
-  This allows us to use doxygen to generate documentation. Doxygen doesn't like \r
-  the classes in the main adodb.inc.php file for some mysterious reason. \r
-<p><b>2.50, 14 Nov 2002</b> \r
-<p>Added transOff and transCnt properties for disabling (transOff = true) and \r
-  tracking transaction status (transCnt>0). \r
-<p>Added inputarray handling into _adodb_pageexecute_all_rows - "Ross Smith" RossSmith#bnw.com. \r
-<p>Fixed postgresql inconsistencies in date handling. \r
-<p>Added support for mssql_fetch_assoc. \r
-<p>Fixed $ADODB_FETCH_MODE bug in odbc MetaTables() and MetaPrimaryKeys(). \r
-<p>Accidentally declared UnixDate() twice, making adodb incompatible with php \r
-  4.3.0. Fixed. \r
-<p>Fixed pager problems with some databases that returned -1 for _currentRow on \r
-  MoveLast() by switching to MoveNext() in adodb-lib.inc.php. \r
-<p>Also fixed uninited $discard in adodb-lib.inc.php. \r
-<p><b>2.43, 25 Oct 2002</b></p>\r
-Added ADODB_ASSOC_CASE constant to better support ibase and odbc field names. \r
-<p>Added support for NConnect() for oracle OCINLogin. \r
-<p>Fixed NumCols() bug. \r
-<p>Changed session handler to use Replace() on write. \r
-<p>Fixed oci8 SelectLimit aggregate function bug again. \r
-<p>Rewrote pivoting code. \r
-<p><b>2.42, 4 Oct 2002</b></p>\r
-<p>Fixed ibase_fetch() problem with nulls. Also interbase now does automatic blob \r
-  decoding, and is backward compatible. Suggested by Heinz Hombergs heinz#hhombergs.de. \r
-<p>Fixed postgresql MoveNext() problems when called repeatedly after EOF. Also \r
-  suggested by Heinz Hombergs. \r
-<p>PageExecute() does not rewrite queries if SELECT DISTINCT is used. Requested \r
-  by hans#velum.net \r
-<p>Added additional fixes to oci8 SelectLimit handling with aggregate functions \r
-  - thx to Christian Bugge for reporting the problem. \r
-<p><b>2.41, 2 Oct 2002</b></p>\r
-<p>Fixed ADODB_COUNTRECS bug in odbc. Thx to Joshua Zoshi jzoshi#hotmail.com. \r
-<p>Increased buffers for adodb-csvlib.inc.php for extremely long sql from 8192 \r
-  to 32000. \r
-<p>Revised pivottable.inc.php code. Added better support for aggregate fields. \r
-<p>Fixed mysql text/blob types problem in MetaTypes base class - thx to horacio \r
-  degiorgi. \r
-<p>Added SQLDate($fmt,$date) function, which allows an sql date format string \r
-  to be generated - useful for group by's. \r
-<p>Fixed bug in oci8 SelectLimit when offset>100. \r
-<p><b>2.40 4 Sept 2002</b></p>\r
-<p>Added new NLS_DATE_FORMAT property to oci8. Suggested by Laurent NAVARRO ln#altidev.com \r
-<p>Now use bind parameters in oci8 selectlimit for better performance. \r
-<p>Fixed interbase replaceQuote for dialect != 1. Thx to "BEGUIN Pierre-Henri \r
-  - INFOCOB" phb#infocob.com. \r
-<p>Added white-space check to QA. \r
-<p>Changed unixtimestamp to support fractional seconds (we always round down/floor \r
-  the seconds). Thanks to beezly#beezly.org.uk. \r
-<p>Now you can set the trigger_error type your own user-defined type in adodb-errorhandler.inc.php. \r
-  Suggested by Claudio Bustos clbustos#entelchile.net. \r
-<p>Added recordset filters with rsfilter.inc.php. \r
-<p>$conn->_rs2rs does not create a new recordset when it detects it is of type \r
-  array. Some trickery there as there seems to be a bug in Zend Engine \r
-<p>Added render_pagelinks to adodb-pager.inc.php. Code by "Pablo Costa" pablo#cbsp.com.br. \r
-<p>MetaType() speedup in adodb.inc.php by using hashing instead of switch. Best \r
-  performance if constant arrays are supported, as they are in PHP5. \r
-<p>adodb-session.php now updates only the expiry date if the crc32 check indicates \r
-  that the data has not been modified. \r
 <hr>\r
 <p><strong>0.10 Sept 9 2000</strong> First release \r
 <h3><strong>Old changelog history moved to <a href=old-changelog.htm>old-changelog.htm</a>. \r
index bb53dc847dc7c406ebf5e2b366cf469f38645f14..6840245a363af21e1e6aea7ef1fb5e022e998e77 100644 (file)
@@ -11,7 +11,7 @@
 <body bgcolor="#FFFFFF">\r
 \r
 <h2>ADOdb Data Dictionary Library for PHP</h2>\r
-<p> V4.00 20 Oct 2003 (c) 2000-2003 John Lim (<a href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>)</p>\r
+<p> V4.01 23 Oct 2003 (c) 2000-2003 John Lim (<a href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a>)</p>\r
 <p><font size=1>This software is dual licensed using BSD-Style and LGPL. This \r
   means you can use it in compiled proprietary and commercial products.</font></p>\r
 <p>Useful ADOdb links:  <a href=http://php.weblogs.com/adodb?dd=1>Download</a> &nbsp; <a href=http://php.weblogs.com/adodb_manual?dd=1>Other Docs</a>\r
diff --git a/lib/adodb/docs-perf.htm b/lib/adodb/docs-perf.htm
new file mode 100644 (file)
index 0000000..05c909c
--- /dev/null
@@ -0,0 +1,379 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
+\r
+<html>\r
+<head>\r
+       <title>ADOdb Performance Monitoring Library</title>\r
+</head>\r
+\r
+<body>\r
+<h3>The ADOdb Performance Monitoring Library</h3>\r
+<p>V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim#natsoft.com.my)</p>\r
+<p><font size="1">This software is dual licensed using BSD-Style and LGPL. This \r
+  means you can use it in compiled proprietary and commercial products.</font></p>\r
+  <p>Useful ADOdb links:  <a href=http://php.weblogs.com/adodb?perf=1>Download</a> &nbsp; <a href=http://php.weblogs.com/adodb_manual?perf=1>Other Docs</a>\r
+<h3>Introduction</h3>\r
+<p>This module, part of the ADOdb package, provides both CLI and HTML interfaces \r
+  for viewing key performance indicators of your database. This is very useful \r
+  because web apps such as the popular phpMyAdmin currently do not provide effective \r
+  database health monitoring tools. The module provides the following: \r
+<ul>\r
+  <li>A quick health check of your database server using <code>$perf->HealthCheck()</code> \r
+    or <code>$perf->HealthCheckCLI()</code>. \r
+  <li>User interface for performance monitoring, <code>$perf-&gt;UI()</code>. \r
+    This UI displays: \r
+    <ul>\r
+      <li>the health check, </li>\r
+      <li>all SQL logged and their query plans, </li>\r
+      <li>a list of all tables in the current database</li>\r
+      <li>an interface to continiously poll the server for key performance indicators \r
+        such as CPU, Hit Ratio, Disk I/O</li>\r
+    </ul>\r
+  <li>Gives you an API to build database monitoring tools for a server farm, for \r
+    example calling <code>$perf->DBParameter('data cache hit ratio')</code> returns \r
+    this very important statistic in a database independant manner. \r
+</ul>\r
+<p>ADOdb also has the ability to log all SQL executed, using <a href=docs-adodb.htm#logsql>LogSQL</a>. \r
+  All SQL logged can be analyzed through the performance monitor <a href=#ui>UI</a>. \r
+  In the <i>View SQL</i> mode, we categorize the SQL into 3 types:\r
+<ul>\r
+  <li><b>Suspicious SQL</b>: queries with high average execution times, and are potential \r
+    candidates for rewriting</li>\r
+  <li><b>Expensive SQL</b>: queries with high total execution times (#executions * avg \r
+    execution time). Optimizing these queries will reduce your database server \r
+    load.</li>\r
+  <li><b>Invalid SQL</b>: queries that generate errors.</li>\r
+</ul>\r
+<p>Each query is hyperlinked to a description of the query plan, and every PHP \r
+  script that executed that query is also shown.</p>\r
+<p>Please note that the information presented is a very basic database health \r
+  check, and does not provide a complete overview of database performance. Although \r
+  some attempt has been made to make it work across multiple databases in the \r
+  same way, it is impossible to do so. For the health check, we do try to display \r
+  the following key database parameters for all drivers:</p>\r
+<ul>\r
+  <li><b>data cache size</b> - The amount of memory allocated to the cache.</li>\r
+  <li><b>data cache hit ratio</b> - A measure of how effective the cache is, as a percentage. \r
+  The higher, the better.</li>\r
+  <li><b>current connections</b> - The number of sessions currently connected to the \r
+    database. </li>\r
+</ul>\r
+<p>You will need to connect to the database as an administrator to view most of \r
+  the parameters. </p>\r
+<p>Code improvements as very welcome, particularly adding new database parameters \r
+  and automated tuning hints.</p><a name=usage></a>\r
+<h3>Usage</h3>\r
+<p>Currently, the following drivers: <em>mysql</em>, <em>postgres</em>, <em>oci8</em>, \r
+  <em>mssql</em>, <i>informix</i> and <em>db2</em> are supported. To create a \r
+  new performance monitor, call NewPerfMonitor( ) as demonstrated below: </p>\r
+<pre>\r
+&lt;?php\r
+include_once('adodb.inc.php');\r
+session_start(); <font color="#006600"># session variables required for monitoring</font>\r
+$conn = ADONewConnection($driver);\r
+$conn-&gt;Connect($server,$user,$pwd,$db);\r
+$perf =&amp; NewPerfMonitor($conn);\r
+$perf-&gt;UI($pollsecs=5);<font color="#006600"></font>\r
+?>\r
+</pre>\r
+<p>It is also possible to retrieve a single database parameter:</p>\r
+<pre>$size = $perf->DBParameter('data cache size');\r
+</pre>\r
+<p>\r
+Thx to Fernando Ortiz for the informix module. \r
+<h3>Methods</h3><a name=ui></a>\r
+<p><font face="Courier New, Courier, mono">function <b>UI($pollsecs=5)</b></font></p>\r
+<p>Creates a web-based user interface for performance monitoring. When you click on Poll, \r
+server statistics will be displayed every $pollsecs seconds.  See <a href="#usage">Usage</a> \r
+  above. Sample output follows below:</p>\r
+\r
+<table border=1 width=100% bgcolor=lightyellow><tr>\r
+    <td> <b><a href=http://php.weblogs.com/adodb?perf=1>ADOdb</a> Performance \r
+      Monitor</b> for localhost, db=test<br>\r
+      <font size=-1>PostgreSQL 7.3.2 on i686-pc-cygwin, compiled by GCC gcc (GCC) \r
+      3.2 20020927 (prerelease)</font></tr>\r
+         <tr><td>\r
+       <a href=#>Performance Stats</a> &nbsp; <a href=#>View SQL</a>\r
+        &nbsp; <a href=#>View Tables</a> &nbsp; <a href=#>Poll Stats</a></tr></table><table border=1 bgcolor=white><tr><td colspan=3><h3>postgres7</h3></td></tr><tr><td><b>Parameter</b></td><td><b>Value</b></td><td><b>Description</b></td></tr><tr bgcolor=#F0F0F0><td colspan=3><i>Ratios</i> &nbsp;</td></tr><tr><td>statistics collector</td><td>TRUE</td><td>Value must be TRUE to enable hit ratio statistics (<i>stats_start_collector</i>,<i>stats_row_level</i> and <i>stats_block_level</i> must be set to true in postgresql.conf)</td></tr>\r
+<tr><td>data cache hit ratio</td><td>99.7967555299239</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>IO</i> &nbsp;</td></tr><tr><td>data reads</td><td>125</td><td>&nbsp;  </td></tr>\r
+<tr><td>data writes</td><td>21.78125000000000000</td><td>Count of inserts/updates/deletes * coef</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Data Cache</i> &nbsp;</td></tr><tr><td>data cache buffers</td><td>640</td><td>Number of cache buffers. <a href=http://www.varlena.com/GeneralBits/Tidbits/perf.html#basic>Tuning</a></td></tr>\r
+<tr><td>cache blocksize</td><td>8192</td><td>(estimate)</td></tr>\r
+<tr><td>data cache size</td><td>5M</td><td>&nbsp;</td></tr>\r
+<tr><td>operating system cache size</td><td>80M</td><td>(effective cache size)</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Memory Usage</i> &nbsp;</td></tr><tr><td>sort buffer size</td><td>1M</td><td>Size of sort buffer (per query)</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Connections</i> &nbsp;</td></tr><tr><td>current connections</td><td>0</td><td>&nbsp;</td></tr>\r
+<tr><td>max connections</td><td>32</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Parameters</i> &nbsp;</td></tr><tr><td>rollback buffers</td><td>8</td><td>WAL buffers</td></tr>\r
+<tr><td>random page cost</td><td>4</td><td>Cost of doing a seek (default=4). See <a href=http://www.varlena.com/GeneralBits/Tidbits/perf.html#less>random_page_cost</a></td></tr>\r
+</table>\r
+<p><font face="Courier New, Courier, mono">function <b>HealthCheck</b>()</font></p> \r
+<p>Returns database health check parameters as a HTML table. You will need to \r
+  echo or print the output of this function,</p>\r
+<p><font face="Courier New, Courier, mono">function <b>HealthCheckCLI</b>()</font></p>\r
+<p>Returns database health check parameters formatted for a command line interface. \r
+  You will need to echo or print the output of this function. Sample output for \r
+  mysql:</p>\r
+<pre>\r
+-- Ratios -- \r
+          MyISAM cache hit ratio => 56.5635738832 \r
+          InnoDB cache hit ratio => 0 \r
+             sql cache hit ratio => 0 \r
+ -- IO -- \r
+                      data reads => 2622 \r
+                     data writes => 2415.5 \r
+ -- Data Cache -- \r
+          MyISAM data cache size => 512K \r
+             BDB data cache size => 8388600\r
+          InnoDB data cache size => 8M\r
+ -- Memory Pools -- \r
+                read buffer size => 131072 \r
+                sort buffer size => 65528 \r
+                     table cache => 4 \r
+ -- Connections -- \r
+             current connections => 3\r
+                 max connections => 100</pre>\r
+<p><font face="Courier New, Courier, mono">function <b>Poll</b>($pollSecs=5) \r
+  </font> \r
+<p> Run in infinite loop, displaying the following information every $pollSecs. \r
+  This will not work properly if output buffering is enabled. \r
+  In the example below, $pollSecs=3:\r
+<pre>\r
+Accumulating statistics...\r
+ Time   WS-CPU%   Hit%   Sess        Reads/s          Writes/s\r
+11:08:30    0.7  56.56      1         0.0000            0.0000\r
+11:08:33    1.8  56.56      2         0.0000            0.0000\r
+11:08:36   11.1  56.55      3         2.5000            0.0000\r
+11:08:39    9.8  56.55      2         3.1121            0.0000\r
+11:08:42    2.8  56.55      1         0.0000            0.0000\r
+11:08:45    7.4  56.55      2         0.0000            1.5000\r
+</pre>\r
+<p><b>WS-CPU%</b> is the Web Server CPU load of the server that PHP is running \r
+  from (eg. the database client), and not the database. The <b>Hit%</b> is the \r
+  data cache hit ratio. <b>Sess</b> is the current number of sessions connected \r
+  to the database. If you are using persistent connections, this should not change \r
+  much. The <b>Reads/s</b> and <b>Writes/s</b> are synthetic values to give the \r
+  viewer a rough guide to I/O, and are not to be taken literally. \r
+<p><font face="Courier New, Courier, mono">function <b>SuspiciousSQL</b>($numsql=10)</font></p>\r
+<p>Returns SQL which have high average execution times as a HTML table. Each sql statement\r
+is hyperlinked to a new window which details the execution plan and the scripts that execute this SQL.\r
+<p> The number of statements returned is determined by $numsql. Data is taken from the adodb_logsql table, where the sql statements are logged when\r
+$connection->LogSQL(true) is enabled. The adodb_logsql table is populated using <a href=docs-adodb.htm#logsql>$conn->LogSQL</a>.\r
+<p>For Oracle, Ixora Suspicious SQL returns a list of SQL statements that are most cache intensive as a HTML table. \r
+  These are data intensive SQL statements that could benefit most from tuning. \r
\r
+<p><font face="Courier New, Courier, mono">function <b>ExpensiveSQL</b>($numsql=10)</font></p>\r
+<p>Returns SQL whose total execution time (avg time * #executions) is high as a HTML table. Each sql statement\r
+is hyperlinked to a new window which details the execution plan and the scripts that execute this SQL.\r
+<p> The number of statements returned is determined by $numsql. Data is taken from the adodb_logsql table, where the sql statements are logged when\r
+$connection->LogSQL(true) is enabled. The adodb_logsql table is populated using <a href=docs-adodb.htm#logsql>$conn->LogSQL</a>.\r
+\r
+<p>For Oracle, Ixora Expensive SQL returns a list of SQL statements that are taking the most CPU load \r
+when run.\r
+<p><font face="Courier New, Courier, mono">function <b>InvalidSQL</b>($numsql=10)</font></p>\r
+<p>Returns a list of invalid SQL as an HTML table.\r
+<p>Data is taken from the adodb_logsql table, where the sql statements are logged when\r
+$connection->LogSQL(true) is enabled.\r
+<p><font face="Courier New, Courier, mono">function <b>Tables</b>($orderby=1)</font></p>\r
+<p>Returns information on all tables in a database, with the first two fields \r
+  containing the table name and table size, the remaining fields depend on the \r
+  database driver. If $orderby is set to 1, it will sort by name. If $orderby \r
+  is set to 2, then it will sort by table size. Some database drivers (mssql and \r
+  mysql) will ignore the $orderby clause. For postgresql, the information is up-to-date \r
+  since the last <i>vacuum</i>. Not supported currently for db2.</p>\r
+<h3>Raw Functions</h3>\r
+<p>Raw functions return values without any formatting.</p>\r
+<p><font face="Courier New, Courier, mono">function <b>DBParameter</b>($paramname)</font></p>\r
+<p>Returns the value of a database parameter, such as $this-&gt;DBParameter(&quot;data \r
+  cache size&quot;).</p>\r
+<p><font face="Courier New, Courier, mono">function <b>CPULoad</b>()</font></p>\r
+<p>Returns the CPU load of the database client (NOT THE SERVER) as a percentage. \r
+  Only works for Linux and Windows. For Windows, WMI must be available.</p>\r
+<h3>Format of $settings Property</h3>\r
+<p> To create new database parameters, you need to understand $settings. The $settings \r
+  data structure is an associative array. Each element of the array defines a \r
+  database parameter. The key is the name of the database parameter. If no key is defined,\r
+  then it is assumed to be a section break, and the value is the name of the section break.\r
+  If this is too confusing, looking at the source code will help a lot!</p>\r
+<p> Each database parameter is itself an array consisting of the following elements:</p>\r
+<ol start="0">\r
+  <li> Category code, used to group related db parameters. If the category code is 'HIDE', then\r
+the database parameter is not shown when HTML() is called. <br>\r
+  </li>\r
+  <li> either \r
+    <ol type="a">\r
+      <li>sql string to retrieve value, eg. "select value from v\$parameter where \r
+        name='db_block_size'", </li>\r
+      <li>array holding sql string and field to look for, e.g. array('show variables','table_cache'); \r
+        optional 3rd parameter is the $rs-&gt;fields[$index] to use (otherwise \r
+        $index=1), and optional 4th parameter is a constant to multiply the result \r
+        with (typically 100 for percentage calculations),</li>\r
+      <li>a string prefixed by =, then a PHP method of the class is invoked, e.g. \r
+        to invoke $this->GetIndexValue(), set this array element to '=GetIndexValue', \r
+        <br>\r
+      </li>\r
+    </ol>\r
+  </li>\r
+  <li> Description of database parameter. If description begins with an =, then \r
+    it is interpreted as a method call, just as in (1c) above, taking one parameter, \r
+    the current value. E.g. '=GetIndexDescription' will invoke $this->GetIndexDescription($val). \r
+    This is useful for generating tuning suggestions. For an example, see WarnCacheRatio().</li>\r
+</ol>\r
+<p>Example from MySQL, table_cache database parameter:</p>\r
+<pre>'table cache' =&gt; array('CACHE',            # category code\r
+   array(&quot;show variables&quot;, 'table_cache'), # array (type 1b)\r
+   'Number of tables to keep open'),       # description</pre>\r
+<h3>Example Health Check Output</h3>\r
+<p><a href="#db2">db2</a> <a href=#informix>informix</a> <a href="#mysql">mysql</a> <a href="#mssql">mssql</a> \r
+  <a href="#oci8">oci8</a> <a href="#postgres">postgres</a></p>\r
+<p><a name=db2></a></p>\r
+<table border=1 bgcolor=white>\r
+  <tr> \r
+    <td colspan=3> <h3>db2</h3></td>\r
+  </tr>\r
+  <tr> \r
+    <td><b>Parameter</b></td>\r
+    <td><b>Value</b></td>\r
+    <td><b>Description</b></td>\r
+  </tr>\r
+  <tr bgcolor=#F0F0F0> \r
+    <td colspan=3><i>Ratios</i> &nbsp;</td>\r
+  </tr>\r
+  <tr bgcolor=#FFFFFF> \r
+    <td>data cache hit ratio</td>\r
+    <td>0 &nbsp; </td>\r
+    <td>&nbsp;</td>\r
+  </tr>\r
+  <tr bgcolor=#F0F0F0>\r
+    <td colspan=3><i>Data Cache</i></td>\r
+  </tr>\r
+  <tr bgcolor=#FFFFFF> \r
+    <td>data cache buffers</td>\r
+    <td>250 &nbsp; </td>\r
+    <td>See <a href=http://www7b.boulder.ibm.com/dmdd/library/techarticle/anshum/0107anshum.html#bufferpoolsize>tuning \r
+      reference</a>.</td>\r
+  </tr>\r
+  <tr bgcolor=#FFFFFF> \r
+    <td>cache blocksize</td>\r
+    <td>4096 &nbsp; </td>\r
+    <td>&nbsp;</td>\r
+  </tr>\r
+  <tr bgcolor=#FFFFFF> \r
+    <td>data cache size</td>\r
+    <td>1000K &nbsp; </td>\r
+    <td>&nbsp;</td>\r
+  </tr>\r
+  <tr bgcolor=#F0F0F0> \r
+    <td colspan=3><i>Connections</i></td>\r
+  </tr>\r
+  <tr bgcolor=#FFFFFF> \r
+    <td>current connections</td>\r
+    <td>2 &nbsp; </td>\r
+    <td>&nbsp;</td>\r
+  </tr>\r
+</table>\r
+<p>&nbsp;<p>\r
+<a name=informix></a>\r
+<table border=1 bgcolor=white><tr><td\r
+colspan=3><h3>informix</h3></td></tr><tr><td><b>Parameter</b></td><td><b>Val\r
+ue</b></td><td><b>Description</b></td></tr><tr bgcolor=#F0F0F0><td\r
+colspan=3><i>Ratios</i> &nbsp;</td></tr><tr><td>data cache hit\r
+ratio</td><td>95.89</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>IO</i> &nbsp;</td></tr><tr><td>data\r
+reads</td><td>1883884</td><td>Page reads</td></tr>\r
+<tr><td>data writes</td><td>1716724</td><td>Page writes</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Connections</i>\r
+&nbsp;</td></tr><tr><td>current connections</td><td>263.0</td><td>Number of\r
+sessions</td></tr>\r
+</table>\r
+\r
+\r
+<p>&nbsp;</p>\r
+<p><a name=mysql id="mysql"></a></p><table border=1 bgcolor=white><tr><td colspan=3><h3>mysql</h3></td></tr><tr><td><b>Parameter</b></td><td><b>Value</b></td><td><b>Description</b></td></tr><tr bgcolor=#F0F0F0><td colspan=3><i>Ratios</i> &nbsp;</td></tr><tr><td>MyISAM cache hit ratio</td><td>56.5658301822</td><td><font color=red><b>Cache ratio should be at least 90%</b></font></td></tr>\r
+<tr><td>InnoDB cache hit ratio</td><td>0</td><td><font color=red><b>Cache ratio should be at least 90%</b></font></td></tr>\r
+<tr><td>sql cache hit ratio</td><td>0</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>IO</i> &nbsp;</td></tr><tr><td>data reads</td><td>2622</td><td>Number of selects (Key_reads is not accurate)</td></tr>\r
+<tr><td>data writes</td><td>2415.5</td><td>Number of inserts/updates/deletes * coef (Key_writes is not accurate)</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Data Cache</i> &nbsp;</td></tr><tr><td>MyISAM data cache size</td><td>512K</td><td>&nbsp;</td></tr>\r
+<tr><td>BDB data cache size</td><td>8388600</td><td>&nbsp;</td></tr>\r
+<tr><td>InnoDB data cache size</td><td>8M</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Memory Pools</i> &nbsp;</td></tr><tr><td>read buffer size</td><td>131072</td><td>(per session)</td></tr>\r
+<tr><td>sort buffer size</td><td>65528</td><td>Size of sort buffer (per session)</td></tr>\r
+<tr><td>table cache</td><td>4</td><td>Number of tables to keep open</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Connections</i> &nbsp;</td></tr><tr><td>current connections</td><td>3</td><td>&nbsp;</td></tr>\r
+<tr><td>max connections</td><td>100</td><td>&nbsp;</td></tr>\r
+</table>\r
+<p>&nbsp;</p>\r
+<p><a name=mssql id="mssql"></a></p>\r
+\r
+<table border=1 bgcolor=white><tr><td colspan=3><h3>mssql</h3></td></tr><tr><td><b>Parameter</b></td><td><b>Value</b></td><td><b>Description</b></td></tr><tr bgcolor=#F0F0F0><td colspan=3><i>Ratios</i> &nbsp;</td></tr><tr><td>data cache hit ratio</td><td>99.9999694824</td><td>&nbsp;</td></tr>\r
+<tr><td>prepared sql hit ratio</td><td>99.7738579828</td><td>&nbsp;</td></tr>\r
+<tr><td>adhoc sql hit ratio</td><td>98.4540169133</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>IO</i> &nbsp;</td></tr><tr><td>data reads</td><td>2858</td><td>&nbsp;  </td></tr>\r
+<tr><td>data writes</td><td>1438</td><td>&nbsp;  </td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Data Cache</i> &nbsp;</td></tr><tr><td>data cache size</td><td>4362</td><td>in K</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Connections</i> &nbsp;</td></tr><tr><td>current connections</td><td>14</td><td>&nbsp;</td></tr>\r
+<tr><td>max connections</td><td>32767</td><td>&nbsp;</td></tr>\r
+</table>\r
+\r
+<p>&nbsp;</p>\r
+<p><a name=oci8 id="oci8"></a></p>\r
+<table border=1 bgcolor=white><tr><td colspan=3><h3>oci8</h3></td></tr><tr><td><b>Parameter</b></td><td><b>Value</b></td><td><b>Description</b></td></tr><tr bgcolor=#F0F0F0><td colspan=3><i>Ratios</i> &nbsp;</td></tr><tr><td>data cache hit ratio</td><td>96.98</td><td>&nbsp;</td></tr>\r
+<tr><td>sql cache hit ratio</td><td>99.96</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>IO</i> &nbsp;</td></tr><tr><td>data reads</td><td>842938</td><td>&nbsp;  </td></tr>\r
+<tr><td>data writes</td><td>16852</td><td>&nbsp;  </td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Data Cache</i> &nbsp;</td></tr><tr><td>data cache buffers</td><td>3072</td><td>Number of cache buffers</td></tr>\r
+<tr><td>data cache blocksize</td><td>8192</td><td>&nbsp;</td></tr>\r
+<tr><td>data cache size</td><td>48M</td><td>shared_pool_size</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Memory Pools</i> &nbsp;</td></tr><tr><td>java pool size</td><td>0</td><td>java_pool_size</td></tr>\r
+<tr><td>sort buffer size</td><td>512K</td><td>sort_area_size (per query)</td></tr>\r
+<tr><td>user session buffer size</td><td>8M</td><td>large_pool_size</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Connections</i> &nbsp;</td></tr><tr><td>current connections</td><td>1</td><td>&nbsp;</td></tr>\r
+<tr><td>max connections</td><td>170</td><td>&nbsp;</td></tr>\r
+<tr><td>data cache utilization ratio</td><td>88.46</td><td>Percentage of data cache actually in use</td></tr>\r
+<tr><td>user cache utilization ratio</td><td>91.76</td><td>Percentage of user cache (large_pool) actually in use</td></tr>\r
+<tr><td>rollback segments</td><td>11</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Transactions</i> &nbsp;</td></tr><tr><td>peak transactions</td><td>24</td><td>Taken from high-water-mark</td></tr>\r
+<tr><td>max transactions</td><td>187</td><td>max transactions / rollback segments < 3.5 (or transactions_per_rollback_segment)</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Parameters</i> &nbsp;</td></tr><tr><td>cursor sharing</td><td>EXACT</td><td>Cursor reuse strategy. Recommended is FORCE (8i+) or SIMILAR (9i+). See <a href=http://www.praetoriate.com/oracle_tips_cursor_sharing.htm>cursor_sharing</a>.</td></tr>\r
+<tr><td>index cache cost</td><td>0</td><td>% of indexed data blocks expected in the cache.\r
+                       Recommended is 20-80. Default is 0. See <a href=http://www.dba-oracle.com/oracle_tips_cbo_part1.htm>optimizer_index_caching</a>.</td></tr>\r
+<tr><td>random page cost</td><td>100</td><td>Recommended is 10-50 for TP, and 50 for data warehouses. Default is 100. See <a href=http://www.dba-oracle.com/oracle_tips_cost_adj.htm>optimizer_index_cost_adj</a>. </td></tr>\r
+</table>\r
+<h3>Suspicious SQL</h3>\r
+\r
+<table border=1 bgcolor=white><tr><td><b>LOAD</b></td><td><b>EXECUTES</b></td><td><b>SQL_TEXT</b></td></tr>\r
+<tr><td align=right>  .73%</td><td align=right>89</td><td>select u.name, o.name, t.spare1, t.pctfree$    from sys.obj$ o, sys.user$ u, sys.tab$ t    where  (bitand(t.trigflag, 1048576) = 1048576) and           o.obj#=t.obj# and o.owner# = u.user# select i.obj#, i.flags, u.name, o.name     from sys.obj$ o, sys.user$ u, sys.ind$ i    where  (bitand(i.flags, 256) = 256 or bitand(i.flags, 512) = 512) and           (not((i.type# = 9) and bitand(i.flags,8) = 8)) and           o.obj#=i.obj# and o.owner# = u.user# </td></tr>\r
+<tr><td align=right>  .84%</td><td align=right>3</td><td>select /*+ RULE */ distinct tabs.table_name, tabs.owner , partitioned, iot_type  , TEMPORARY, table_type, table_type_owner  from DBA_ALL_TABLES tabs  where tabs.owner = :own  </td></tr>\r
+<tr><td align=right> 3.95%</td><td align=right>6</td><td>SELECT round(count(1)*avg(buf.block_size)/1048576) FROM DBA_OBJECTS obj, V$BH bh, dba_segments seg, v$buffer_pool buf WHERE obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = seg.owner and obj.object_name = seg.segment_name and obj.object_type = seg.segment_type and seg.buffer_pool = buf.name and buf.name = 'DEFAULT'  </td></tr>\r
+<tr><td align=right> 4.50%</td><td align=right>6</td><td>SELECT round(count(1)*avg(tsp.block_size)/1048576) FROM DBA_OBJECTS obj, V$BH bh, dba_segments seg, dba_tablespaces tsp WHERE obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = seg.owner and obj.object_name = seg.segment_name and obj.object_type = seg.segment_type and seg.tablespace_name = tsp.tablespace_name  </td></tr>\r
+<tr><td align=right>57.34%</td><td align=right>9267</td><td>select t.schema, t.name, t.flags, q.name from system.aq$_queue_tables t, sys.aq$_queue_table_affinities aft,      system.aq$_queues q where aft.table_objno = t.objno and aft.owner_instance = :1 and        q.table_objno = t.objno and q.usage = 0 and       bitand(t.flags, 4+16+32+64+128+256) = 0 for update of t.name, aft.table_objno skip locked </td></tr></table>\r
+\r
+<h3>Expensive SQL</h3>\r
+\r
+<table border=1 bgcolor=white><tr><td><b>LOAD</b></td><td><b>EXECUTES</b></td><td><b>SQL_TEXT</b></td></tr>\r
+<tr><td align=right> 5.24%</td><td align=right>1</td><td>select round(sum(bytes)/1048576) from dba_segments  </td></tr>\r
+<tr><td align=right> 6.89%</td><td align=right>6</td><td>SELECT round(count(1)*avg(buf.block_size)/1048576) FROM DBA_OBJECTS obj, V$BH bh, dba_segments seg, v$buffer_pool buf WHERE obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = seg.owner and obj.object_name = seg.segment_name and obj.object_type = seg.segment_type and seg.buffer_pool = buf.name and buf.name = 'DEFAULT'  </td></tr>\r
+<tr><td align=right> 7.85%</td><td align=right>6</td><td>SELECT round(count(1)*avg(tsp.block_size)/1048576) FROM DBA_OBJECTS obj, V$BH bh, dba_segments seg, dba_tablespaces tsp WHERE obj.object_id = bh.objd AND obj.owner != 'SYS' and obj.owner = seg.owner and obj.object_name = seg.segment_name and obj.object_type = seg.segment_type and seg.tablespace_name = tsp.tablespace_name  </td></tr>\r
+<tr><td align=right>33.69%</td><td align=right>89</td><td>select u.name, o.name, t.spare1, t.pctfree$    from sys.obj$ o, sys.user$ u, sys.tab$ t    where  (bitand(t.trigflag, 1048576) = 1048576) and           o.obj#=t.obj# and o.owner# = u.user# </td></tr>\r
+<tr><td align=right>36.44%</td><td align=right>89</td><td>select i.obj#, i.flags, u.name, o.name     from sys.obj$ o, sys.user$ u, sys.ind$ i    where  (bitand(i.flags, 256) = 256 or bitand(i.flags, 512) = 512) and           (not((i.type# = 9) and bitand(i.flags,8) = 8)) and           o.obj#=i.obj# and o.owner# = u.user# </td></tr></table>\r
+\r
+<p><a name=postgres id="postgres"></a></p>\r
+\r
+<table border=1 bgcolor=white><tr><td colspan=3><h3>postgres7</h3></td></tr><tr><td><b>Parameter</b></td><td><b>Value</b></td><td><b>Description</b></td></tr><tr bgcolor=#F0F0F0><td colspan=3><i>Ratios</i> &nbsp;</td></tr><tr><td>statistics collector</td><td>FALSE</td><td>Must be set to TRUE to enable hit ratio statistics (<i>stats_start_collector</i>,<i>stats_row_level</i> and <i>stats_block_level</i> must be set to true in postgresql.conf)</td></tr>\r
+<tr><td>data cache hit ratio</td><td>99.9666031916603</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>IO</i> &nbsp;</td></tr><tr><td>data reads</td><td>15</td><td>&nbsp;  </td></tr>\r
+<tr><td>data writes</td><td>0.000000000000000000</td><td>Count of inserts/updates/deletes * coef</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Data Cache</i> &nbsp;</td></tr><tr><td>data cache buffers</td><td>1280</td><td>Number of cache buffers. <a href=http://www.varlena.com/GeneralBits/Tidbits/perf.html#basic>Tuning</a></td></tr>\r
+<tr><td>cache blocksize</td><td>8192</td><td>(estimate)</td></tr>\r
+<tr><td>data cache size</td><td>10M</td><td>&nbsp;</td></tr>\r
+<tr><td>operating system cache size</td><td>80000K</td><td>(effective cache size)</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Memory Pools</i> &nbsp;</td></tr><tr><td>sort buffer size</td><td>1M</td><td>Size of sort buffer (per query)</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Connections</i> &nbsp;</td></tr><tr><td>current connections</td><td>13</td><td>&nbsp;</td></tr>\r
+<tr><td>max connections</td><td>32</td><td>&nbsp;</td></tr>\r
+<tr bgcolor=#F0F0F0><td colspan=3><i>Parameters</i> &nbsp;</td></tr><tr><td>rollback buffers</td><td>8</td><td>WAL buffers</td></tr>\r
+<tr><td>random page cost</td><td>4</td><td>Cost of doing a seek (default=4). See <a href=http://www.varlena.com/GeneralBits/Tidbits/perf.html#less>random_page_cost</a></td></tr>\r
+</table>\r
+\r
+</body>\r
+</html>\r
index 790317f181bcace71e634c6473a90c8ecc639562..16ca8cdc5fe0cfa54e29d7311f380ce17393cc24 100644 (file)
@@ -11,7 +11,7 @@
 <body bgcolor="#FFFFFF">\r
 <h3>ADODB Session Management Manual</h3>\r
 <p>\r
-V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim#natsoft.com.my)\r
+V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim#natsoft.com.my)\r
 <p> <font size=1>This software is dual licensed using BSD-Style and LGPL. This \r
   means you can use it in compiled proprietary and commercial products. </font> \r
 <p>Useful ADOdb links:  <a href=http://php.weblogs.com/adodb>Download</a> &nbsp; <a href=http://php.weblogs.com/adodb_manual>Other Docs</a>\r
index 609a91881d4bfa7f26947214f16b273f08602715..e1078ee5d9557f731ed8898b1f7951c0b0306c32 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index 47de3107264055885479f327eb9481afa71c7d6b..3100d058465a210b8c64276a2d9e3e1f05d21474 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 99aff905bc803fd85ee352637e445349d2d9cb97..4cb590e79f7035f434b8916efba11dd2f53bc7e7 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
 Released under both BSD license and Lesser GPL library license. \r
 Whenever there is any discrepancy between the two licenses, \r
 the BSD license will take precedence. See License.txt. \r
index c3a9d8b067b86c7ade2a821658300353400b6446..0e8b676ce8f8d965d3531a917cdbc67c069eb772 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 02824bca14913516a1cc5be3eb5f1dca2ad2aa91..b585cc5e3af4c00aa4b3e9efb4dfeff8ea10a94c 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 724b3550819159a7089af6ee00372d559b06d2a2..1f584af46afd13c05b47ce0540544d6a1d0904a4 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 4360a87a6559ea14241ff85f12b506f54c522400..be68a98f750c6e81231c4a053ce826ded6129b02 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 87633afa41f16ede77c9a623e187db500471f57e..459a8533a73bc7fb9f7c53a72b108f589b6c6ecb 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
- @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 22e013a0959f77ff0868f23873d4125fa6bd9b46..2edf263ae7321ae76e6a2efd97d35f9c6c5e0d25 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 4f06511f7ab773d57b643989fcac8cc9525c5b8f..6a44559fe645645988c41fe66283a225dc6d8902 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.  \r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.  \r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index eec04e0ed577e1f30c1bf36c7d8f7eb2de5e0708..7f3ed4ac041d5ceaaf4a1c0d33522eb0f864e8f3 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /**\r
-* @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+* @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
 * Released under both BSD license and Lesser GPL library license.\r
 * Whenever there is any discrepancy between the two licenses,\r
 * the BSD license will take precedence.\r
index 31e223603244ea43f55a8b69e96f5f313335854f..4e090e95700bc307ef14bccadc3a5eb8067a33bb 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim. All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim. All rights reserved.\r
   Released under both BSD license and Lesser GPL library license.\r
   Whenever there is any discrepancy between the two licenses,\r
   the BSD license will take precedence.\r
@@ -114,10 +114,12 @@ class ADODB_informix72 extends ADOConnection {
                return $this->_errorMsg;\r
        }\r
 \r
-   function ErrorNo() \r
-   {\r
-         return ifx_error();\r
-   }\r
+       function ErrorNo()\r
+       {\r
+               preg_match("/.*SQLCODE=([^\]]*)/",ifx_error(),$parse); //!EOS\r
+               if (is_array($parse) && isset($parse[1])) return (int)$parse[1]; \r
+               return 0;\r
+       }\r
 \r
    \r
     function &MetaColumns($table)\r
index 9f543cb9cd376f14120f1d8485785a23a7c5e7e7..69fa7d4fb8fff95a91e6e308fce40475585e82f7 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index b9e8e4e851d26875f9067610aef6a76b8139dd48..747abdd95c88fe1860a10e1642826d3b80daf7ba 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /**\r
-* @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+* @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
 * Released under both BSD license and Lesser GPL library license.\r
 * Whenever there is any discrepancy between the two licenses,\r
 * the BSD license will take precedence.\r
index 4643495a9213fe2ecaa28231ab81e633fb921360..17389c3a2eaa310c9a32c4fe67fb186a14865a2b 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
@@ -36,6 +36,7 @@ class ADODB_mysql extends ADOConnection {
        var $clientFlags = 0;\r
        var $dbxDriver = 1;\r
        var $substr = "substring";\r
+       var $lastInsID = false;\r
        \r
        function ADODB_mysql() \r
        {                       \r
index 9522404fb2286a27b76d96578578ae81c0456830..2c3dc95b5e36c117236aa94026a2a39d8a3e88df 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index c529d0c79332faeae13a6de9c191df3583d3dd5a..03ff2d280a9fd0192e7fc700de9c0e7c09ad3ba0 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 /*\r
 \r
-  version V4.00 20 Oct 2003 (c) 2000-2003 John Lim. All rights reserved.\r
+  version V4.01 23 Oct 2003 (c) 2000-2003 John Lim. All rights reserved.\r
 \r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
@@ -449,7 +449,8 @@ NATSOFT.DOMAIN =
                         }\r
                         \r
                         if (is_array($inputarr)) {\r
-                                foreach($inputarr as $k => $v) {\r
+                                reset($inputarr);\r
+                                while (list($k,$v) = each($inputarr)) {\r
                                        if (is_array($v)) {\r
                                                if (sizeof($v) == 2) // suggested by g.giunta@libero.\r
                                                        OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1]);\r
@@ -746,7 +747,8 @@ NATSOFT.DOMAIN =
                                } else {\r
                                // one statement to bind them all\r
                                        $bindarr = array();\r
-                                       foreach($inputarr as $k => $v) {\r
+                                       reset($inputarr);\r
+                                       while(list($k,$v) = each($inputarr)) {\r
                                                $bindarr[$k] = $v;\r
                                                OCIBindByName($stmt,":$k",$bindarr[$k],4000);\r
                                        }\r
@@ -763,7 +765,8 @@ NATSOFT.DOMAIN =
                if (defined('ADODB_PREFETCH_ROWS')) @OCISetPrefetch($stmt,ADODB_PREFETCH_ROWS);\r
                        \r
                if (is_array($inputarr)) {\r
-                       foreach($inputarr as $k => $v) {\r
+                       reset($inputarr);\r
+                       while(list($k,$v) = each($inputarr)) {\r
                                if (is_array($v)) {\r
                                        if (sizeof($v) == 2) // suggested by g.giunta@libero.\r
                                                OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1]);\r
index d93dd804547a75a13e7465a5d48578f36544c5a8..704de4175cef7702928e218c9d91eb8e91f2e366 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index 6ec092d0cbdcc4fdea6bd20cdefea573716f3575..a8e08e8eb29466222f5e1b1fe45b0bdffbafa696 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim. All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim. All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 040f6a799195b59a2b0ba390600d6f2d9f653958..b9b8ac01f5368172ab12fb28c5399952afc43635 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 6042c26e84e4b5a26f539ceb32b5758fcb262873..19a0b2cfef1d9ea0763625408cbb26d05d2be96d 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 6e909680911f0215b75a6bfb2c8ba244eb598188..8647b1baea73e690e94e427f828150c9fa045e1e 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index abb9680f08df8cd6858f4ede36061dc92ea6f059..b724ff17450229ae9b1fe57d40ef5ef9b95b5977 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index dadb4e78c88bcc96cfa9da433bd288bfae5de479..be049c4f11f93389ed95a1e28b33bd32fc7aa526 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
- V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index b79d4c9a7005e91c2ef1fa4a4b75c560f882ead8..d8ac97c9d3b79982339332b7f55db8c82561a762 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
- V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
@@ -746,16 +746,14 @@ class ADORecordSet_postgres64 extends ADORecordSet{
        function _fixblobs()\r
        {\r
                if ($this->fetchMode == PGSQL_NUM || $this->fetchMode == PGSQL_BOTH) {\r
-                       foreach($this->_blobArr as $k => $v) {\r
+                       reset($this->_blobArr);\r
+                       while(list($k,$v) = each($this->_blobArr)) {\r
                                $this->fields[$k] = ADORecordSet_postgres64::_decode($this->fields[$k]);\r
                        }\r
                }\r
                if ($this->fetchMode == PGSQL_ASSOC || $this->fetchMode == PGSQL_BOTH) {\r
-                       foreach($this->_blobArr as $k => $v) {\r
-                               if (!isset($this->fields[$v])) {\r
-                                       $this->fields = false;\r
-                                       return;\r
-                               }\r
+                       reset($this->_blobArr);\r
+                       while(list($k,$v) = each($this->_blobArr)) {\r
                                $this->fields[$v] = ADORecordSet_postgres64::_decode($this->fields[$v]);\r
                        }\r
                }\r
index 00edb2e31da6e0531639cc69851e39afdcfad9e4..8e923eefd30b91254caaad463a2ccf3835aa2862 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
- V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 6440abd7140033590f48692af08845504d50f348..c53e057d6574d063506195f38bd716a099f840cf 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index bc6911424eec211c09d11c8dacbb2c64e7c0a4b0..a75c11c859a15eb22219d8e8a9ebe596bede612d 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index c7c8f15b459a3e20219da3a99245b4bccf045e60..bf0a940221b6c38ea97fe0a92a99707c9ebf86f3 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-version V4.00 20 Oct 2003 (c) 2000-2003  John Lim (jlim@natsoft.com.my). All rights\r
+version V4.01 23 Oct 2003 (c) 2000-2003  John Lim (jlim@natsoft.com.my). All rights\r
 reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
index dc20dc5e6edb377d5e49e4f8b44e51d43db8991c..0228c2c98ce2a8e8f8e2cdc987b0e5c563d6e17a 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 1cb55e3c59486b6f875ea131cf512b9bb46c4d44..1291162ad1c99601f0dae2548135193045c1b97b 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim. All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim. All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 557ad542165dd88af2164e7c44175e56906e146d..42dddf9d1626cb87c14fc135f90d74dc1b8e3aca 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index c5721c79ec07c9f07bc8027d8b8999d4ebcf3006..bc73ab3a6f89b72d0d730800df959b8480289cb3 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index a5a0448d5c9962741278b8fff797e232f7801ecd..3ee4b923dc9aa08d179a4629bcfc9250197fb039 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index b8cad648d33b392fcdaa7930b52268e3bce8c856..ddf0f8f0178ed9c0c0deccb7fd2389151ae02a4a 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index 7e1ff35ed57463ce80adf68716052bd656d012dc..9e038c6dd4c948042bc64ae80f327b894ebb6a5f 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index d18b43285fdb2cd3f314289e1f4f89838c166b4d..e301a225c2b4f8009aec490c90de491e8816f484 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index 57a99e39adfb6d49606719e432fa834db5645451..f0d97b1a5a7dd59705a916e2ffc87a97e5c1e8fe 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. See License.txt. \r
index 96317d33a28ee17436f17c9e1c5b65655222bbe5..96834f37232dc421867fba8bbc47feccf3c305d0 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index e1499a2dbb5f713429099e7b5538db8b78e2d392..6c23d52b7f3f6f7cc9aa506f30d4ad89984045e3 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index feb27aac53c82dfe8dac2b4995395356480d3f84..43b47f8117b37cd8a836a3ea4fb3e55bd01cded4 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index f38898c8800a1d218dfb7b18e669c9c7d3ab2a03..76db3c12a0b069ec76c4de9ea1f05fab14ad0c25 100644 (file)
@@ -8,7 +8,7 @@
 <body>\r
 <?php \r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index d22489cc1de6a358d6f59481f4b65af423e48d7f..0248ba318b2756fe840b19f105225a38c101e716 100644 (file)
@@ -2,7 +2,7 @@
 <body bgcolor=white>\r
 <?php\r
 /** \r
- * V4.00 20 Oct 2003  (c) 2001-2002 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * V4.01 23 Oct 2003  (c) 2001-2002 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 3aa19c0053a3809e80dc33612727be1de0882d55..7bcf7d06523423e7c6e76d487bef45e1329a0a6e 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 /*\r
 \r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 595fccd508aff74633f7e1bc73311e744145a146..80058f71b6f3632de76ba396a661dfa0090e8ecb 100644 (file)
@@ -1,4 +1,7 @@
 <?PHP\r
+\r
+// V4.01 23 Oct 2003\r
+\r
 error_reporting(E_ALL);\r
 \r
 require( "../adodb-xmlschema.inc.php" );\r
index 5d6d5606912ff03ae7921ca4f75b3fe181e67707..70cd45cd856263b6e42aec7d19f03304186aa798 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
@@ -89,7 +89,17 @@ GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE, $HTTP_GET_VARS,$ADODB_COU
        \r
        if (empty($_GET['nolog'])) {\r
                echo "<h3>SQL Logging enabled</h3>";\r
-               $db->LogSQL();\r
+               $db->LogSQL();/*\r
+               $sql =\r
+"SELECT t1.sid, t1.sid, t1.title, t1.hometext, t1.notes, t1.aid, t1.informant, \r
+t2.url, t2.email, t1.catid, t3.title, t1.topic, t4.topicname, t4.topicimage, \r
+t4.topictext, t1.score, t1.ratings, t1.counter, t1.comments, t1.acomm \r
+FROM `nuke_stories` `t1`, `nuke_authors` `t2`, `nuke_stories_cat` `t3`, `nuke_topics` `t4` \r
+       WHERE ((t2.aid=t1.aid) AND (t3.catid=t1.catid) AND (t4.topicid=t1.topic) \r
+       AND ((t1.alanguage='german') OR (t1.alanguage='')) AND (t1.ihome='0')) \r
+       ORDER BY t1.time DESC";\r
+               $db->SelectLimit($sql);\r
+               echo $db->ErrorMsg();*/\r
        }\r
        $ADODB_CACHE_DIR = dirname(TempNam('/tmp','testadodb'));\r
        $db->debug = false;\r
@@ -140,7 +150,7 @@ GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE, $HTTP_GET_VARS,$ADODB_COU
        else $rs->Close();\r
                \r
        //if ($db->databaseType !='vfp') $db->Execute("drop table ADOXYZ");\r
-               \r
+       \r
        if ($create) {\r
                if (false && $db->databaseType == 'ibase') {\r
                        print "<b>Please create the following table for testing:</b></p>$createtab</p>";\r
@@ -448,11 +458,49 @@ END adodb;
        $time = $db->DBDate(time());\r
        if (empty($HTTP_GET_VARS['hide'])) $db->debug = true;\r
        switch($db->databaseType){\r
-       default:\r
+       case 'mssqlpo':\r
+       case 'mssql':\r
+               $sqlt = "CREATE TABLE mytable (\r
+  row1 INT  IDENTITY(1,1) NOT NULL,\r
+  row2 varchar(16),\r
+  PRIMARY KEY  (row1))";\r
+               //$db->debug=1;\r
+               if (!$db->Execute("delete from mytable")) \r
+                       $db->Execute($sqlt);\r
+                       \r
+               $ok = $db->Execute("insert into mytable (row2) values ('test')");\r
+               $ins_id=$db->Insert_ID();\r
+               echo "Insert ID=";var_dump($ins_id);\r
+               if ($ins_id == 0) Err("Bad Insert_ID()");\r
+               $ins_id2 = $db->GetOne("select row1 from mytable");\r
+               if ($ins_id != $ins_id2) Err("Bad Insert_ID() 2");\r
+               \r
                $arr = array(0=>'Caroline',1=>'Miranda');\r
                $sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,?,?,$time)";\r
                break;\r
                \r
+       case 'mysql':\r
+               $sqlt = "CREATE TABLE `mytable` (\r
+  `row1` int(11) NOT NULL auto_increment,\r
+  `row2` varchar(16) NOT NULL default '',\r
+  PRIMARY KEY  (`row1`),\r
+  KEY `myindex` (`row1`,`row2`)\r
+) ";\r
+               if (!$db->Execute("delete from mytable")) \r
+                       $db->Execute($sqlt);\r
+                       \r
+               $ok = $db->Execute("insert into mytable (row2) values ('test')");\r
+               $ins_id=$db->Insert_ID();\r
+               echo "Insert ID=";var_dump($ins_id);\r
+               if ($ins_id == 0) Err("Bad Insert_ID()");\r
+               $ins_id2 = $db->GetOne("select row1 from mytable");\r
+               if ($ins_id != $ins_id2) Err("Bad Insert_ID() 2");\r
+               \r
+       default:\r
+               $arr = array(0=>'Caroline',1=>'Miranda');\r
+               $sql = "insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+0,?,?,$time)";\r
+               break;\r
+       \r
        case 'oci8':\r
        case 'oci805':\r
                $arr = array('first'=>'Caroline','last'=>'Miranda');\r
@@ -469,7 +517,9 @@ END adodb;
        else $rs->Close();\r
        $db->debug = false;\r
        $db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+1,'John','Lim',$time)");\r
-       echo "Insert ID=";var_dump($db->Insert_ID());\r
+       /*$ins_id=$db->Insert_ID();\r
+       echo "Insert ID=";var_dump($ins_id);*/\r
+       if ($db->databaseType == 'mysql') if ($ins_id == 0) Err('Bad Insert_ID');\r
        $db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+2,'Mary','Lamb',$time )");\r
        $db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+3,'George','Washington',$time )");\r
        $db->Execute("insert into ADOXYZ (id,firstname,lastname,created) values ($i*10+4,'Mr. Alan','Tam',$time )");\r
@@ -1147,7 +1197,29 @@ END adodb;
        \r
        if ($pear) print "<p>PEAR DB emulation passed.</p>";\r
        \r
-\r
+       $rs = $db->SelectLimit("select ".$db->sysDate." from adoxyz",1);\r
+       $date = $rs->fields[0];\r
+       if (!$date) Err("Bad sysDate");\r
+       else {\r
+               $ds = $db->UserDate($date,"d m Y");\r
+               if ($ds != date("d m Y")) Err("Bad UserDate: ".$ds);\r
+               else echo "Passed UserDate: $ds<p>";\r
+       }\r
+       \r
+       $rs = $db->SelectLimit("select ".$db->sysTimeStamp." from adoxyz",1);\r
+       $date = $rs->fields[0];\r
+       if (!$date) Err("Bad sysTimeStamp");\r
+       else {\r
+               $ds = $db->UserTimeStamp($date,"H \\h\\r\\s-d m Y");\r
+               if ($ds != date("H \\h\\r\\s-d m Y")) Err("Bad UserTimeStamp: ".$ds);\r
+               else echo "Passed UserTimeStamp: $ds<p>";\r
+               \r
+               $date = 100;\r
+               $ds = $db->UserTimeStamp($date,"H \\h\\r\\s-d m Y");\r
+               $ds2 = date("H \\h\\r\\s-d m Y",$date);\r
+               if ($ds != $ds2) Err("Bad UserTimeStamp 2: $ds: $ds2");\r
+               else echo "Passed UserTimeStamp 2: $ds<p>";\r
+       }\r
        if ($db->hasTransactions) {\r
                //$db->debug=1;\r
                echo "<p>Testing StartTrans CompleteTrans</p>";\r
index c6492807fcc38f39cd287681276e1d6f55941f49..266fdd82591fbb2625e12aee79919bf668aeff1a 100644 (file)
@@ -8,7 +8,7 @@
 <body>\r
 <?php\r
 /*\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 9da45fa0d5d569aeda522ad8f8fe4ece0e72d6b5..122c712ca1f3a6c79882e522aa6512f1b05c1f6f 100644 (file)
@@ -1,7 +1,7 @@
 <code>\r
 <?php\r
 /*\r
-  V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index 0ae650d6777a9da61fc33067df4d43b133a1646b..7648ddd8bd701196e228b09d5506ed4a09235315 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index e8bfe8769df74dd6dcce416eef50f74ee6a755fb..3c1ef063db3d028a00ff7e17c39ae758cedbfac3 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 0624ec9194347151bcac67690f162cd9370c5f21..7881e836fe825da128943109256f8c12874b6aed 100644 (file)
@@ -2,7 +2,7 @@
 <body>\r
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index cb017c216f630520bfdd81fa0ddf195cfbba9392..276332ab7f9560caf4f1878d23b6e0dc32dc7f85 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
   \r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
index cbdd02b7b32fab77ed90f1d06317a762458097a5..f1f946349f890dbebdb9a7ccd67c145d90b90407 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /*\r
-       V4.00 20 Oct 2003 \r
+       V4.01 23 Oct 2003 \r
        \r
        Run multiple copies of this php script at the same time\r
        to test unique generation of id's in multiuser mode\r
index 3f2c1f110b26299d3e44bfbc1cb03a18cf63dd38..b259a69d4a99498f5f1501c076b561681cedb830 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index f338dc04515183fdbd0535dbae1914c0ff0392e6..39c049d00009bac26ca73e893f022768714f2c34 100644 (file)
@@ -2,7 +2,7 @@
 <body>\r
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 7bd6c1e6f3b6d26e64adfaad697185bb1bbe8fa3..51bb4624fa0bd8955949f1a12074b50e5612fc94 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 2f62da01ad614cfc2157d62fd7c71a893b61502e..b0bbcfd2fc7e783502becc81474da1c463eae1c1 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 161783736c544c0f402cbcdf08a36868c707bc35..48d37934131e33630b61494d8ea9929581030b9e 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index 306616bfd00c67c07be21c3d42ce8455713378fc..42d659270647ac3227cae1119a1c99d977aa23c5 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 /* \r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence. \r
index b5bfbcfbec5e78839079fa4491237eee5e5d34ed..05fd2036f7e988fef02f5b21d7a5f8d22af1be70 100644 (file)
@@ -1,7 +1,7 @@
 <?php\r
 \r
 /** \r
- * @version V4.00 20 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+ * @version V4.01 23 Oct 2003 (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
  * Released under both BSD license and Lesser GPL library license. \r
  * Whenever there is any discrepancy between the two licenses, \r
  * the BSD license will take precedence. \r
index a6cc503c2f82f2732d3d24f27ba029d2a5fcfdb8..cf08639b5fe23f34d6fa92994eefef3b1db70e4f 100644 (file)
@@ -1,6 +1,6 @@
 <?php \r
 /*\r
-V4.00 20 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
+  V4.01 23 Oct 2003  (c) 2000-2003 John Lim (jlim@natsoft.com.my). All rights reserved.\r
   Released under both BSD license and Lesser GPL library license. \r
   Whenever there is any discrepancy between the two licenses, \r
   the BSD license will take precedence.\r
@@ -72,7 +72,9 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows;
                $s .= "<TR valign=top>\n";\r
                \r
                for ($i=0; $i < $ncols; $i++) {\r
-                       $v = ($numoffset)? $rs->fields[$i] : next($rs->fields);\r
+                       if ($i===0) $v=($numoffset) ? $rs->fields[0] : reset($rs->fields);\r
+                       else $v = ($numoffset) ? $rs->fields[$i] : next($rs->fields);\r
+                       \r
                        $type = $typearr[$i];\r
                        switch($type) {\r
                        case 'T':\r