]> git.mjollnir.org Git - moodle.git/commitdiff
Whoops ... last conversion actully tampered with comment formatting
authormartin <martin>
Mon, 9 Sep 2002 06:23:39 +0000 (06:23 +0000)
committermartin <martin>
Mon, 9 Sep 2002 06:23:39 +0000 (06:23 +0000)
... I've fixed that now.

55 files changed:
lib/adodb/adodb-cryptsession.php
lib/adodb/adodb-csvlib.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-session.php
lib/adodb/adodb.inc.php
lib/adodb/crypt.inc.php
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-informix72.inc.php
lib/adodb/drivers/adodb-mssql.inc.php
lib/adodb/drivers/adodb-mysql.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-sqlanywhere.inc.php
lib/adodb/drivers/adodb-sybase.inc.php
lib/adodb/drivers/adodb-vfp.inc.php
lib/adodb/readme.htm
lib/adodb/server.php
lib/adodb/tests/benchmark.php
lib/adodb/tests/client.php
lib/adodb/tests/test.php
lib/adodb/tests/test2.php
lib/adodb/tests/test4.php
lib/adodb/tests/test5.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/testpaging.php
lib/adodb/tests/testpear.php
lib/adodb/tips_portable_sql.htm
lib/adodb/toexport.inc.php
lib/adodb/tohtml.inc.php
lib/adodb/tute.htm

index c757f54b4196a8b99e7610779e3a2828ba1265a4..f6d89f9358b2d0c80a8f63e14e5c61893cabb470 100644 (file)
@@ -75,7 +75,7 @@ GLOBAL        $ADODB_SESSION_CONNECT,
        $ADODB_SESS_DEBUG,
        $ADODB_SESS_INSERT; 
 
-       /* $ADODB_SESS_DEBUG = true; */
+       //$ADODB_SESS_DEBUG = true;
        
        /* SET THE FOLLOWING PARAMETERS */
 if (empty($ADODB_SESSION_DRIVER)) {
@@ -101,8 +101,8 @@ $ADODB_CRYPT_KEY = 'CRYPTED ADODB SESSIONS ROCK!';
 
 $ADODB_SESS_LIFE = get_cfg_var('session.gc_maxlifetime');
 if ($ADODB_SESS_LIFE <= 1) {
-       /*  bug in PHP 4.0.3 pl 1  -- how about other versions? */
-       /* print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $ADODB_SESS_LIFE</h3>"; */
+       // bug in PHP 4.0.3 pl 1  -- how about other versions?
+       //print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $ADODB_SESS_LIFE</h3>";
        $ADODB_SESS_LIFE=1440;
 }
 
@@ -148,7 +148,7 @@ global $ADODB_SESS_CONN,$ADODB_SESS_INSERT,$ADODB_SESSION_TBL;
                        $ADODB_SESS_INSERT = true;
                        $v = '';
                } else {
-                       /*  Decrypt session data */
+                       // Decrypt session data
                        $v = rawurldecode($Crypt->Decrypt(reset($rs->fields), ADODB_Session_Key()));
                }
                $rs->Close();
@@ -166,7 +166,7 @@ $Crypt = new MD5Crypt;
 
        $expiry = time() + $ADODB_SESS_LIFE;
 
-       /*  encrypt session data..       */
+       // encrypt session data..       
        $val = $Crypt->Encrypt(rawurlencode($val), ADODB_Session_Key());
        $qry = "UPDATE $ADODB_SESSION_TBL SET expiry=$expiry,data='$val' WHERE sesskey='$key'";
        $rs = $ADODB_SESS_CONN->Execute($qry);
@@ -179,8 +179,8 @@ $Crypt = new MD5Crypt;
                if ($rs) $rs->Close();
                else print '<p>Session Insert: '.$ADODB_SESS_CONN->ErrorMsg().'</p>';
        }
-       /*  bug in access driver (could be odbc?) means that info is not commited */
-       /*  properly unless select statement executed in Win2000 */
+       // bug in access driver (could be odbc?) means that info is not commited
+       // properly unless select statement executed in Win2000
        if ($ADODB_SESS_CONN->databaseType == 'access') $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
 
        return isset($rs);
@@ -203,7 +203,7 @@ function adodb_sess_gc($maxlifetime) {
        $rs = $ADODB_SESS_CONN->Execute($qry);
        if ($rs) $rs->Close();
        
-       /*  suggested by Cameron, "GaM3R" <gamr@outworld.cx> */
+       // suggested by Cameron, "GaM3R" <gamr@outworld.cx>
        if (defined('ADODB_SESSION_OPTIMIZE'))
        {
                switch( $ADODB_SESSION_DRIVER ) {
index 6d213a17594829e37372efe7bf48aa017fddec7a..50a3bf093c5312eee152f55987852d5930bff6aa 100644 (file)
@@ -29,9 +29,9 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                $max = ($rs) ? $rs->FieldCount() : 0;
                
                if ($sql) $sql = urlencode($sql);
-               /*  metadata setup */
+               // metadata setup
                
-               if ($max <= 0 || $rs->dataProvider == 'empty') { /*  is insert/update/delete */
+               if ($max <= 0 || $rs->dataProvider == 'empty') { // is insert/update/delete
                        if (is_object($conn)) {
                        $sql .= ','.$conn->Affected_Rows();
                                $sql .= ','.$conn->Insert_ID();
@@ -44,7 +44,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                        $tt = ($rs->timeCreated) ? $rs->timeCreated : time();
                        $line = "====0,$tt,$sql\n";
                }
-               /*  column definitions */
+               // column definitions
                for($i=0; $i < $max; $i++) {
                        $o = $rs->FetchField($i);
                        $line .= urlencode($o->name).':'.$rs->MetaType($o->type,$o->max_length).":$o->max_length,";
@@ -52,7 +52,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                $text = substr($line,0,strlen($line)-1)."\n";
                
                
-               /*  get data */
+               // get data
                if ($rs->databaseType == 'array') {
                        $text .= serialize($rs->_array);
                } else {
@@ -92,15 +92,15 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                $ttl = 0;
                
                if ($meta = fgetcsv ($fp, 8192, ",")) {
-                       /*  check if error message */
+                       // check if error message
                        if (substr($meta[0],0,4) === '****') {
                                $err = trim(substr($meta[0],4,1024));
                                fclose($fp);
                                return false;
                        }
-                       /*  check for meta data */
-                       /*  $meta[0] is -1 means return an empty recordset */
-                       /*  $meta[1] contains a time  */
+                       // check for meta data
+                       // $meta[0] is -1 means return an empty recordset
+                       // $meta[1] contains a time 
        
                        if (substr($meta[0],0,4) ===  '====') {
                        
@@ -156,10 +156,10 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                                                                fclose($fp);
                                                                $err = "Timeout 0";
                                                                return false;
-                                                       } /*  switch */
+                                                       } // switch
                                                        
-                                               } /*  if check flush cache */
-                                       }/*  (timeout>0) */
+                                               } // if check flush cache
+                                       }// (timeout>0)
                                        $ttl = $meta[1];
                                }
                                $meta = fgetcsv($fp, 8192, ",");
@@ -170,7 +170,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                                }
                        }
 
-                       /*  Get Column definitions */
+                       // Get Column definitions
                        $flds = array();
                        foreach($meta as $o) {
                                $o2 = explode(':',$o);
@@ -188,12 +188,12 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                } else {
                        fclose($fp);
                        $err = "Recordset had unexpected EOF 2";
-                       /* print "$url ";print_r($meta); */
-                       /* die(); */
+                       //print "$url ";print_r($meta);
+                       //die();
                        return false;
                }
                
-               /*  slurp in the data */
+               // slurp in the data
                $MAXSIZE = 128000;
                $text = fread($fp,$MAXSIZE);
                $cnt = 1;
@@ -205,7 +205,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
                fclose($fp);
                $arr = @unserialize($text);
                
-               /* var_dump($arr); */
+               //var_dump($arr);
                if (!is_array($arr)) {
                        $err = "Recordset had unexpected EOF 3";
                        return false;
index ba170d9d9ecb2ca86abe484ad74346d710fc76e9..fb89039a6ecd9b92631b841a2a9c25a886445a66 100644 (file)
@@ -67,7 +67,7 @@ function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false)
        }
 
 
-       /* print "<p>$s</p>"; */
+       //print "<p>$s</p>";
        trigger_error($s,E_USER_ERROR);
 }
 ?>
index 5669f1cd3d9fee91d5a2bf19cb4960c32478722f..b82b72876e2e7b013bef159dc73a635cc2a9d660 100644 (file)
@@ -17,7 +17,7 @@ define('ADODB_ERROR_HANDLER','ADODB_Error_PEAR');
 /*
 * Enabled the following if you want to terminate scripts when an error occurs
 */
-/* PEAR::setErrorHandling (PEAR_ERROR_DIE); */
+//PEAR::setErrorHandling (PEAR_ERROR_DIE);
 
 /*
 * Name of the PEAR_Error derived class to call.
@@ -69,7 +69,7 @@ global $ADODB_Last_PEAR_Error;
                $GLOBALS['_PEAR_default_error_options'], 
                $errmsg);
                
-       /* print "<p>!$s</p>"; */
+       //print "<p>!$s</p>";
 }
 
 /**
index 50c3910192eec933ae8163c943182daab81e0774..57f8ac09ee1f62159c9132edd2aabe6156776ca6 100644 (file)
@@ -10,7 +10,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
 */ 
 
 
-/*  Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM */
+// Requires $ADODB_FETCH_MODE = ADODB_FETCH_NUM
 function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false,
                        $size=0, $selectAttr='',$compareFields0=true)
 {
@@ -61,7 +61,7 @@ function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=f
                                $s .= "\n<option".$value.'>'.htmlspecialchars($zval).'</option>';
                }
                $zthis->MoveNext();
-       } /*  while */
+       } // while
        
        return $s ."\n</select>\n";
 }
@@ -82,25 +82,25 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
        $atlastpage = false;
        $lastpageno=1;
 
-       /*  If an invalid nrows is supplied,  */
-       /*  we assume a default value of 10 rows per page */
+       // If an invalid nrows is supplied, 
+       // we assume a default value of 10 rows per page
        if (!isset($nrows) || $nrows <= 0) $nrows = 10;
 
-       $qryRecs = false; /* count records for no offset */
+       $qryRecs = false; //count records for no offset
        
-       /*  jlim - attempt query rewrite first */
+       // jlim - attempt query rewrite first
        $rewritesql = preg_replace(
                '/^\s*SELECT\s.*\sFROM\s/is','SELECT COUNT(*) FROM ',$sql);
                
        if ($rewritesql != $sql){
                
-               /*  fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails  */
-               /*  with mssql, access and postgresql */
+               // fix by alexander zhukov, alex#unipack.ru, because count(*) and 'order by' fails 
+               // with mssql, access and postgresql
                $rewritesql = preg_replace('/(\sORDER\s+BY\s.*)/is','',$rewritesql); 
                
                if ($secs2cache) {
-                       /*  we only use half the time of secs2cache because the count can quickly */
-                       /*  become inaccurate if new records are added */
+                       // we only use half the time of secs2cache because the count can quickly
+                       // become inaccurate if new records are added
                        $rs = $zthis->CacheExecute($secs2cache/2,$rewritesql);
                        if ($rs) {
                                if (!$rs->EOF) $qryRecs = reset($rs->fields);
@@ -111,11 +111,11 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
                        $lastpageno = (int) ceil($qryRecs / $nrows);
        }
        
-       /*  query rewrite failed - so try slower way... */
+       // query rewrite failed - so try slower way...
        if ($qryRecs === false) {
                $rstest = &$zthis->Execute($sql);
                if ($rstest) {
-               /* save total records */
+               //save total records
                    $qryRecs = $rstest->RecordCount();
                        if ($qryRecs == -1)
                                if (!$rstest->EOF) {
@@ -131,21 +131,21 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
        
        $zthis->_maxRecordCount = $qryRecs;
     
-       /*  If page number <= 1, then we are at the first page */
+       // If page number <= 1, then we are at the first page
        if (!isset($page) || $page <= 1) {      
                $page = 1;
                $atfirstpage = true;
        }
 
-       /*  ***** Here we check whether $page is the last page or  */
-       /*  whether we are trying to retrieve  */
-       /*  a page number greater than the last page number. */
+       // ***** Here we check whether $page is the last page or 
+       // whether we are trying to retrieve 
+       // a page number greater than the last page number.
        if ($page >= $lastpageno) {
                $page = $lastpageno;
                $atlastpage = true;
        }
        
-       /*  We get the data we want */
+       // We get the data we want
        $offset = $nrows * ($page-1);
        if ($secs2cache > 0) 
                $rsreturn = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr, $arg3);
@@ -153,7 +153,7 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
                $rsreturn = &$zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $arg3, $secs2cache);
 
        
-       /*  Before returning the RecordSet, we set the pagination properties we need */
+       // Before returning the RecordSet, we set the pagination properties we need
        if ($rsreturn) {
                $rsreturn->rowsPerPage = $nrows;
                $rsreturn->AbsolutePage($page);
@@ -164,21 +164,21 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
        return $rsreturn;
 }
 
-/*  Iván Oliva version */
+// Iván Oliva version
 function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $arg3=false, $secs2cache=0) 
 {
 
        $atfirstpage = false;
        $atlastpage = false;
        
-       if (!isset($page) || $page <= 1) {      /*  If page number <= 1, then we are at the first page */
+       if (!isset($page) || $page <= 1) {      // If page number <= 1, then we are at the first page
                $page = 1;
                $atfirstpage = true;
        }
-       if ($nrows <= 0) $nrows = 10;   /*  If an invalid nrows is supplied, we assume a default value of 10 rows per page */
+       if ($nrows <= 0) $nrows = 10;   // If an invalid nrows is supplied, we assume a default value of 10 rows per page
        
-       /*  ***** Here we check whether $page is the last page or whether we are trying to retrieve a page number greater than  */
-       /*  the last page number. */
+       // ***** Here we check whether $page is the last page or whether we are trying to retrieve a page number greater than 
+       // the last page number.
        $pagecounter = $page + 1;
        $pagecounteroffset = ($pagecounter * $nrows) - $nrows;
        if ($secs2cache>0) $rstest = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $pagecounteroffset, $inputarr, $arg3);
@@ -194,18 +194,18 @@ function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputar
                }
                if ($rstest) $rstest->Close();
        }
-       if ($atlastpage) {      /*  If we are at the last page or beyond it, we are going to retrieve it */
+       if ($atlastpage) {      // If we are at the last page or beyond it, we are going to retrieve it
                $page = $pagecounter;
-               if ($page == 1) $atfirstpage = true;    /*  We have to do this again in case the last page is the same as the first */
-                       /* ... page, that is, the recordset has only 1 page. */
+               if ($page == 1) $atfirstpage = true;    // We have to do this again in case the last page is the same as the first
+                       //... page, that is, the recordset has only 1 page.
        }
        
-       /*  We get the data we want */
+       // We get the data we want
        $offset = $nrows * ($page-1);
        if ($secs2cache > 0) $rsreturn = &$zthis->CacheSelectLimit($secs2cache, $sql, $nrows, $offset, $inputarr, $arg3);
        else $rsreturn = &$zthis->SelectLimit($sql, $nrows, $offset, $inputarr, $arg3, $secs2cache);
        
-       /*  Before returning the RecordSet, we set the pagination properties we need */
+       // Before returning the RecordSet, we set the pagination properties we need
        if ($rsreturn) {
                $rsreturn->rowsPerPage = $nrows;
                $rsreturn->AbsolutePage($page);
@@ -224,42 +224,42 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
        
                $fieldUpdatedCount = 0;
                
-               /*  Get the table name from the existing query. */
+               // Get the table name from the existing query.
                preg_match("/FROM\s".ADODB_TABLE_REGEX."/i", $rs->sql, $tableName);
 
-               /*  Get the full where clause excluding the word "WHERE" from */
-               /*  the existing query. */
+               // Get the full where clause excluding the word "WHERE" from
+               // the existing query.
                preg_match("/WHERE\s(.*)/i", $rs->sql, $whereClause);
 
-               /*  updateSQL will contain the full update query when all */
-               /*  processing has completed. */
+               // updateSQL will contain the full update query when all
+               // processing has completed.
                $updateSQL = "UPDATE " . $tableName[1] . " SET ";
                
-               /*  Loop through all of the fields in the recordset */
+               // Loop through all of the fields in the recordset
                for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) {
                
-                       /*  Get the field from the recordset */
+                       // Get the field from the recordset
                        $field = $rs->FetchField($i);
 
-                       /*  If the recordset field is one */
-                       /*  of the fields passed in then process. */
+                       // If the recordset field is one
+                       // of the fields passed in then process.
                        if (isset($arrFields[$field->name])) {
 
-                               /*  If the existing field value in the recordset */
-                               /*  is different from the value passed in then */
-                               /*  go ahead and append the field name and new value to */
-                               /*  the update query. */
+                               // If the existing field value in the recordset
+                               // is different from the value passed in then
+                               // go ahead and append the field name and new value to
+                               // the update query.
 
                                if ($forceUpdate || strcmp($rs->fields[$i], $arrFields[$field->name])) {
-                                       /*  Set the counter for the number of fields that will be updated. */
+                                       // Set the counter for the number of fields that will be updated.
                                        $fieldUpdatedCount++;
 
-                                       /*  Based on the datatype of the field */
-                                       /*  Format the value properly for the database */
+                                       // Based on the datatype of the field
+                                       // Format the value properly for the database
                                        $mt = $rs->MetaType($field->type);
                                        
-                                       /*  "mike" <mike@partner2partner.com> patch and "Ryan Bailey" <rebel@windriders.com>  */
-                                       /* PostgreSQL uses a 't' or 'f' and therefore needs to be processed as a string ('C') type field. */
+                                       // "mike" <mike@partner2partner.com> patch and "Ryan Bailey" <rebel@windriders.com> 
+                                       //PostgreSQL uses a 't' or 'f' and therefore needs to be processed as a string ('C') type field.
                                        if ((substr($zthis->databaseType,0,8) == "postgres") && ($mt == "L")) $mt = "C";
 
                                        switch($mt) {
@@ -281,13 +281,13 @@ function _adodb_getupdatesql(&$zthis,&$rs, $arrFields,$forceUpdate=false,$magicq
                };
                };
 
-               /*  If there were any modified fields then build the rest of the update query. */
+               // If there were any modified fields then build the rest of the update query.
                if ($fieldUpdatedCount > 0 || $forceUpdate) {
-                       /*  Strip off the comma and space on the end of the update query. */
+                       // Strip off the comma and space on the end of the update query.
                        $updateSQL = substr($updateSQL, 0, -2);
 
-                       /*  If the recordset has a where clause then use that same where clause */
-                       /*  for the update. */
+                       // If the recordset has a where clause then use that same where clause
+                       // for the update.
                        if ($whereClause[1]) $updateSQL .= " WHERE " . $whereClause[1];
 
                        return $updateSQL;
@@ -308,32 +308,32 @@ function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false)
 
                $fieldInsertedCount = 0;
        
-               /*  Get the table name from the existing query. */
+               // Get the table name from the existing query.
                preg_match("/FROM\s".ADODB_TABLE_REGEX."/i", $rs->sql, $tableName);
 
-               /*  Loop through all of the fields in the recordset */
+               // Loop through all of the fields in the recordset
                for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) {
 
-                       /*  Get the field from the recordset */
+                       // Get the field from the recordset
                        $field = $rs->FetchField($i);
-                       /*  If the recordset field is one */
-                       /*  of the fields passed in then process. */
+                       // If the recordset field is one
+                       // of the fields passed in then process.
                        if (isset($arrFields[$field->name])) {
        
-                               /*  Set the counter for the number of fields that will be inserted. */
+                               // Set the counter for the number of fields that will be inserted.
                                $fieldInsertedCount++;
 
-                               /*  Get the name of the fields to insert */
+                               // Get the name of the fields to insert
                                $fields .= $field->name . ", ";
                                
                                $mt = $rs->MetaType($field->type);
                                
-                               /*  "mike" <mike@partner2partner.com> patch and "Ryan Bailey" <rebel@windriders.com>  */
-                               /* PostgreSQL uses a 't' or 'f' and therefore needs to be processed as a string ('C') type field. */
+                               // "mike" <mike@partner2partner.com> patch and "Ryan Bailey" <rebel@windriders.com> 
+                               //PostgreSQL uses a 't' or 'f' and therefore needs to be processed as a string ('C') type field.
                                if ((substr($zthis->databaseType,0,8) == "postgres") && ($mt == "L")) $mt = "C";
 
-                               /*  Based on the datatype of the field */
-                               /*  Format the value properly for the database */
+                               // Based on the datatype of the field
+                               // Format the value properly for the database
                                switch($mt) {
                                        case "C":
                                        case "X":
@@ -352,15 +352,15 @@ function _adodb_getinsertsql(&$zthis,&$rs,$arrFields,$magicq=false)
                };
        };
 
-               /*  If there were any inserted fields then build the rest of the insert query. */
+               // If there were any inserted fields then build the rest of the insert query.
                if ($fieldInsertedCount > 0) {
 
-                       /*  Strip off the comma and space on the end of both the fields */
-                       /*  and their values. */
+                       // Strip off the comma and space on the end of both the fields
+                       // and their values.
                        $fields = substr($fields, 0, -2);
                        $values = substr($values, 0, -2);
 
-                       /*  Append the fields and their values to the insert query. */
+                       // Append the fields and their values to the insert query.
                        $insertSQL = "INSERT INTO " . $tableName[1] . " ( $fields ) VALUES ( $values )";
 
                        return $insertSQL;
index c09f44a6c8bb85575073481b859d14cb7f234888..37beaa3a78d9be2c5d8b7502b73bdb888d35d551 100644 (file)
        delete records. 
 */
 class ADODB_Pager {
-       var $id;        /*  unique id for pager (defaults to 'adodb') */
-       var $db;        /*  ADODB connection object */
-       var $sql;       /*  sql used */
-       var $rs;        /*  recordset generated */
-       var $curr_page; /*  current page number before Render() called, calculated in constructor */
-       var $rows;              /*  number of rows per page */
+       var $id;        // unique id for pager (defaults to 'adodb')
+       var $db;        // ADODB connection object
+       var $sql;       // sql used
+       var $rs;        // recordset generated
+       var $curr_page; // current page number before Render() called, calculated in constructor
+       var $rows;              // number of rows per page
        
        var $gridAttributes = 'width=100% border=1 bgcolor=white';
        
-       /*  Localize text strings here */
+       // Localize text strings here
        var $first = '<code>|&lt;</code>';
        var $prev = '<code>&lt;&lt;</code>';
        var $next = '<code>>></code>';
@@ -40,15 +40,15 @@ class ADODB_Pager {
        var $page = 'Page';
        var $cache = 0;  #secs to cache with CachePageExecute()
        
-       /* ---------------------------------------------- */
-       /*  constructor */
-       /*  */
-       /*  $db adodb connection object */
-       /*  $sql        sql statement */
-       /*  $id optional id to identify which pager,  */
-       /*              if you have multiple on 1 page.  */
-       /*              $id should be only be [a-z0-9]* */
-       /*  */
+       //----------------------------------------------
+       // constructor
+       //
+       // $db  adodb connection object
+       // $sql sql statement
+       // $id  optional id to identify which pager, 
+       //              if you have multiple on 1 page. 
+       //              $id should be only be [a-z0-9]*
+       //
        function ADODB_Pager(&$db,$sql,$id = 'adodb')
        {
        global $HTTP_SERVER_VARS,$PHP_SELF,$HTTP_SESSION_VARS,$HTTP_GET_VARS;
@@ -71,8 +71,8 @@ class ADODB_Pager {
                
        }
        
-       /* --------------------------- */
-       /*  Display link to first page */
+       //---------------------------
+       // Display link to first page
        function Render_First($anchor=true)
        {
        global $PHP_SELF;
@@ -85,8 +85,8 @@ class ADODB_Pager {
                }
        }
        
-       /* -------------------------- */
-       /*  Display link to next page */
+       //--------------------------
+       // Display link to next page
        function render_next($anchor=true)
        {
        global $PHP_SELF;
@@ -100,12 +100,12 @@ class ADODB_Pager {
                }
        }
        
-       /* ------------------ */
-       /*  Link to last page */
-       /*   */
-       /*  for better performance with large recordsets, you can set */
-       /*  $this->db->pageExecuteCountRows = false, which disables */
-       /*  last page counting. */
+       //------------------
+       // Link to last page
+       /
+       // for better performance with large recordsets, you can set
+       // $this->db->pageExecuteCountRows = false, which disables
+       // last page counting.
        function render_last($anchor=true)
        {
        global $PHP_SELF;
@@ -121,8 +121,8 @@ class ADODB_Pager {
                }
        }
        
-       /* ---------------------- */
-       /*  Link to previous page */
+       //----------------------
+       // Link to previous page
        function render_prev($anchor=true)
        {
        global $PHP_SELF;
@@ -135,14 +135,14 @@ class ADODB_Pager {
                }
        }
        
-       /* -------------------------------------------------------- */
-       /*  Simply rendering of grid. You should override this for */
-       /*  better control over the format of the grid */
-       /*  */
-       /*  We use output buffering to keep code clean and readable. */
+       //--------------------------------------------------------
+       // Simply rendering of grid. You should override this for
+       // better control over the format of the grid
+       //
+       // We use output buffering to keep code clean and readable.
        function RenderGrid()
        {
-       global $gSQLBlockRows; /*  used by rs2html to indicate how many rows to display */
+       global $gSQLBlockRows; // used by rs2html to indicate how many rows to display
                include_once(ADODB_DIR.'/tohtml.inc.php');
                ob_start();
                $gSQLBlockRows = $this->rows;
@@ -152,10 +152,10 @@ class ADODB_Pager {
                return $s;
        }
        
-       /* ------------------------------------------------------- */
-       /*  Navigation bar */
-       /*  */
-       /*  we use output buffering to keep the code easy to read. */
+       //-------------------------------------------------------
+       // Navigation bar
+       //
+       // we use output buffering to keep the code easy to read.
        function RenderNav()
        {
                ob_start();
@@ -178,16 +178,16 @@ class ADODB_Pager {
                return $s;
        }
        
-       /* ------------------- */
-       /*  This is the footer */
+       //-------------------
+       // This is the footer
        function RenderPageCount()
        {
                if (!$this->db->pageExecuteCountRows) return '';
                return "<font size=-1>$this->page ".$this->curr_page."/".$this->rs->LastPageNo()."</font>";
        }
        
-       /* ----------------------------------- */
-       /*  Call this class to draw everything. */
+       //-----------------------------------
+       // Call this class to draw everything.
        function Render($rows=10)
        {
        global $ADODB_COUNTRECS;
@@ -221,8 +221,8 @@ class ADODB_Pager {
                $this->RenderLayout($header,$grid,$footer);
        }
        
-       /* ------------------------------------------------------ */
-       /*  override this to control overall layout and formating */
+       //------------------------------------------------------
+       // override this to control overall layout and formating
        function RenderLayout($header,$grid,$footer)
        {
                echo "<table border=1 bgcolor=beige><tr><td>",
index 71af9320b6eec1eb3dcd0af54b47a6a42226e4a7..a057331640e899db525ca9b09a4520a7db5856a1 100644 (file)
@@ -140,7 +140,7 @@ class DB
 
         if (is_array($options) && isset($options["debug"]) &&
             $options["debug"] >= 2) {
-            /*  expose php errors with sufficient debug level */
+            // expose php errors with sufficient debug level
              @include_once("adodb-$type.inc.php");
         } else {
              @include_once("adodb-$type.inc.php");
@@ -251,8 +251,8 @@ class DB
             'password' => false
         );
 
-        /*  Find phptype and dbsyntax */
-        if (($pos = strpos($dsn, ':/* ')) !== false) { */
+        // Find phptype and dbsyntax
+        if (($pos = strpos($dsn, '://')) !== false) {
             $str = substr($dsn, 0, $pos);
             $dsn = substr($dsn, $pos + 3);
         } else {
@@ -260,8 +260,8 @@ class DB
             $dsn = NULL;
         }
 
-        /*  Get phptype and dbsyntax */
-        /*  $str => phptype(dbsyntax) */
+        // Get phptype and dbsyntax
+        // $str => phptype(dbsyntax)
         if (preg_match('|^(.+?)\((.*?)\)$|', $str, $arr)) {
             $parsed['phptype'] = $arr[1];
             $parsed['dbsyntax'] = (empty($arr[2])) ? $arr[1] : $arr[2];
@@ -274,8 +274,8 @@ class DB
             return $parsed;
         }
 
-        /*  Get (if found): username and password */
-        /*  $dsn => username:password@protocol+hostspec/database */
+        // Get (if found): username and password
+        // $dsn => username:password@protocol+hostspec/database
         if (($at = strpos($dsn,'@')) !== false) {
             $str = substr($dsn, 0, $at);
             $dsn = substr($dsn, $at + 1);
@@ -287,8 +287,8 @@ class DB
             }
         }
 
-        /*  Find protocol and hostspec */
-        /*  $dsn => protocol+hostspec/database */
+        // Find protocol and hostspec
+        // $dsn => protocol+hostspec/database
         if (($pos=strpos($dsn, '/')) !== false) {
             $str = substr($dsn, 0, $pos);
             $dsn = substr($dsn, $pos + 1);
@@ -297,8 +297,8 @@ class DB
             $dsn = NULL;
         }
 
-        /*  Get protocol + hostspec */
-        /*  $str => protocol+hostspec */
+        // Get protocol + hostspec
+        // $str => protocol+hostspec
         if (($pos=strpos($str, '+')) !== false) {
             $parsed['protocol'] = substr($str, 0, $pos);
             $parsed['hostspec'] = urldecode(substr($str, $pos + 1));
@@ -306,8 +306,8 @@ class DB
             $parsed['hostspec'] = urldecode($str);
         }
 
-        /*  Get dabase if any */
-        /*  $dsn => database */
+        // Get dabase if any
+        // $dsn => database
         if (!empty($dsn)) {
             $parsed['database'] = $dsn;
         }
index 9ec5d93cc6926d1d5de42b76efe550fe4702bd0f..ba830df369282bb107219f62d4f83087abdc2c8d 100644 (file)
@@ -73,16 +73,16 @@ GLOBAL      $ADODB_SESSION_CONNECT,
        
        $ADODB_SESS_LIFE = get_cfg_var('session.gc_maxlifetime');
        if ($ADODB_SESS_LIFE <= 1) {
-        /*  bug in PHP 4.0.3 pl 1  -- how about other versions? */
-        /* print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $ADODB_SESS_LIFE</h3>"; */
+        // bug in PHP 4.0.3 pl 1  -- how about other versions?
+        //print "<h3>Session Error: PHP.INI setting <i>session.gc_maxlifetime</i>not set: $ADODB_SESS_LIFE</h3>";
                $ADODB_SESS_LIFE=1440;
        }
        $ADODB_SESSION_CRC = false;
-       /* $ADODB_SESS_DEBUG = true; */
+       //$ADODB_SESS_DEBUG = true;
        
-       /* //////////////////////////////// */
+       //////////////////////////////////
        /* SET THE FOLLOWING PARAMETERS */
-       /* //////////////////////////////// */
+       //////////////////////////////////
        
        if (empty($ADODB_SESSION_DRIVER)) {
                $ADODB_SESSION_DRIVER='mysql';
@@ -92,7 +92,7 @@ GLOBAL        $ADODB_SESSION_CONNECT,
                $ADODB_SESSION_DB ='xphplens_2';
        }
        
-       /*   Made table name configurable - by David Johnson djohnson@inpro.net */
+       //  Made table name configurable - by David Johnson djohnson@inpro.net
        if (empty($ADODB_SESSION_TBL)){
                $ADODB_SESSION_TBL = 'sessions';
        }
@@ -105,7 +105,7 @@ GLOBAL      $ADODB_SESSION_CONNECT,
 function adodb_sess_open($save_path, $session_name,$persist=true) 
 {
 GLOBAL $ADODB_SESS_CONN;
-       /* if( $persist) print "PERSIST "; */
+       //if( $persist) print "PERSIST ";
        if (isset($ADODB_SESS_CONN)) return true;
        
 GLOBAL         $ADODB_SESSION_CONNECT, 
@@ -115,7 +115,7 @@ GLOBAL      $ADODB_SESSION_CONNECT,
        $ADODB_SESSION_DB,
        $ADODB_SESS_DEBUG;
        
-       /*  cannot use & below - do not know why... */
+       // cannot use & below - do not know why...
        $ADODB_SESS_CONN = ADONewConnection($ADODB_SESSION_DRIVER);
        if (!empty($ADODB_SESS_DEBUG)) {
                $ADODB_SESS_CONN->debug = true;
@@ -158,14 +158,14 @@ global $ADODB_SESS_CONN,$ADODB_SESS_INSERT,$ADODB_SESSION_TBL,$ADODB_SESSION_CRC
                        
                $rs->Close();
                
-               /*  new optimization adodb 2.1 */
+               // new optimization adodb 2.1
                $ADODB_SESSION_CRC = crc32($v);
                
                return $v;
        }
        else $ADODB_SESS_INSERT = true;
        
-       return ''; /*  thx to Jorma Tuomainen, webmaster#wizactive.com */
+       return ''; // thx to Jorma Tuomainen, webmaster#wizactive.com
 }
 
 /****************************************************************************************\
@@ -184,7 +184,7 @@ function adodb_sess_write($key, $val)
 
        $expiry = time() + $ADODB_SESS_LIFE;
        
-       /*  new optimization adodb 2.1 */
+       // new optimization adodb 2.1
        if ($ADODB_SESSION_CRC !== false && $ADODB_SESSION_CRC == crc32($val)) {
                if ($ADODB_SESS_DEBUG) echo "<p>Session: No need to update - crc32 not changed</p>";
                return true;
@@ -201,8 +201,8 @@ function adodb_sess_write($key, $val)
                if ($rs) $rs->Close();
                else print '<p>Session Insert: '.$ADODB_SESS_CONN->ErrorMsg().'</p>';
        }
-       /*  bug in access driver (could be odbc?) means that info is not commited */
-       /*  properly unless select statement executed in Win2000 */
+       // bug in access driver (could be odbc?) means that info is not commited
+       // properly unless select statement executed in Win2000
        if ($ADODB_SESS_CONN->databaseType == 'access') $rs = $ADODB_SESS_CONN->Execute("select sesskey from $ADODB_SESSION_TBL WHERE sesskey='$key'");
 
        return isset($rs);
@@ -225,7 +225,7 @@ function adodb_sess_gc($maxlifetime)
        $rs = $ADODB_SESS_CONN->Execute($qry);
        if ($rs) $rs->Close();
        
-       /*  suggested by Cameron, "GaM3R" <gamr@outworld.cx> */
+       // suggested by Cameron, "GaM3R" <gamr@outworld.cx>
        if (defined('ADODB_SESSION_OPTIMIZE'))
        {
                switch( $ADODB_SESSION_DRIVER ) {
index b99eb184795bd41e4fa7162ffcb8c8f41a948365..a499f6c59578fc6c533024af5f4c2bdba1b07437 100644 (file)
@@ -20,9 +20,9 @@
  if (!defined('_ADODB_LAYER')) {
        define('_ADODB_LAYER',1);
        
-       /* ==============================================================================================        */
-       /*  CONSTANT DEFINITIONS */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CONSTANT DEFINITIONS
+       //==============================================================================================        
 
        define('ADODB_BAD_RS','<p>Bad $rs in %s. Connection or SQL invalid. Try using $connection->debug=true;</p>');
        
@@ -31,9 +31,9 @@
        define('ADODB_FETCH_ASSOC',2);
        define('ADODB_FETCH_BOTH',3);
        
-       /*  allow [ ] @ and . in table names */
+       // allow [ ] @ and . in table names
        define('ADODB_TABLE_REGEX','([]0-9a-z_\.\@\[-]*)');
-       if (!defined('MAX_BLOB_SIZE')) define('MAX_BLOB_SIZE',999999); /*  900K */
+       if (!defined('MAX_BLOB_SIZE')) define('MAX_BLOB_SIZE',999999); // 900K
        
        if (!defined('ADODB_PREFETCH_ROWS')) define('ADODB_PREFETCH_ROWS',10);
 
        if (!defined('ADODB_DIR')) define('ADODB_DIR',dirname(__FILE__));
        
        if (strpos(strtoupper(PHP_OS),'WIN') !== false) {
-       /*  windows, negative timestamps are illegal as of php 4.2.0 */
+       // windows, negative timestamps are illegal as of php 4.2.0
                define('TIMESTAMP_FIRST_YEAR',1970);
        } else
                define('TIMESTAMP_FIRST_YEAR',1904);
        
-       /* ==============================================================================================        */
-       /*  GLOBAL VARIABLES */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // GLOBAL VARIABLES
+       //==============================================================================================        
 
        GLOBAL 
-               $ADODB_vers,            /*  database version */
-               $ADODB_Database,        /*  last database driver used */
-               $ADODB_COUNTRECS,       /*  count number of records returned - slows down query */
-               $ADODB_CACHE_DIR,       /*  directory to cache recordsets */
-               $ADODB_FETCH_MODE;      /*  DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default... */
+               $ADODB_vers,            // database version
+               $ADODB_Database,        // last database driver used
+               $ADODB_COUNTRECS,       // count number of records returned - slows down query
+               $ADODB_CACHE_DIR,       // directory to cache recordsets
+               $ADODB_FETCH_MODE;      // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default...
        
-       /* ==============================================================================================        */
-       /*  GLOBAL SETUP */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // GLOBAL SETUP
+       //==============================================================================================        
        
        $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT;
        
        if (!isset($ADODB_CACHE_DIR)) {
                $ADODB_CACHE_DIR = '/tmp';
        } else {
-               /*  do not accept url based paths, eg. http:/ or ftp:/ */
-               if (strpos($ADODB_CACHE_DIR,':/* ') !== false)  */
-                       die("Illegal path http:/*  or ftp://"); */
+               // do not accept url based paths, eg. http:/ or ftp:/
+               if (strpos($ADODB_CACHE_DIR,'://') !== false) 
+                       die("Illegal path http:// or ftp://");
        }
        
-       /* ==============================================================================================        */
-       /*  CHANGE NOTHING BELOW UNLESS YOU ARE CODING */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CHANGE NOTHING BELOW UNLESS YOU ARE CODING
+       //==============================================================================================        
 
        
-       /*  Initialize random number generator for randomizing cache flushes */
+       // Initialize random number generator for randomizing cache flushes
        srand(((double)microtime())*1000000);
        
        /**
@@ -99,9 +99,9 @@
         */
        $ADODB_COUNTRECS = true; 
 
-       /* ==============================================================================================        */
-       /*  CLASS ADOFieldObject */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CLASS ADOFieldObject
+       //==============================================================================================        
 
        /**
         * Helper class for FetchFields -- holds info on a column
                var $max_length=0;
                var $type="";
 
-               /*  additional fields by dannym... (danny_milo@yahoo.com) */
+               // additional fields by dannym... (danny_milo@yahoo.com)
                var $not_null = false; 
-               /*  actually, this has already been built-in in the postgres, fbsql AND mysql module? ^-^ */
-               /*  so we can as well make not_null standard (leaving it at "false" does not harm anyways) */
+               // actually, this has already been built-in in the postgres, fbsql AND mysql module? ^-^
+               // so we can as well make not_null standard (leaving it at "false" does not harm anyways)
 
-               var $has_default = false; /*  this one I have done only in mysql and postgres for now ...  */
-                       /*  others to come (dannym) */
-               var $default_value; /*  default, if any, and supported. Check has_default first. */
+               var $has_default = false; // this one I have done only in mysql and postgres for now ... 
+                       // others to come (dannym)
+               var $default_value; // default, if any, and supported. Check has_default first.
        }
        
        
-       /* ==============================================================================================        */
-       /*  CLASS ADOConnection */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CLASS ADOConnection
+       //==============================================================================================        
        
        /**
         * Connection object. For connecting to databases, and executing queries.
         * PUBLIC VARS 
         */
        var $dataProvider = 'native';
-       var $databaseType = '';         /*  RDBMS currently in use, eg. odbc, mysql, mssql                                       */
-       var $database = '';                     /*  Name of database to be used.         */
-       var $host = '';                         /*  The hostname of the database server  */
-       var $user = '';                         /*  The username which is used to connect to the database server.  */
-       var $password = '';             /*  Password for the username */
-       var $debug = false;             /*  if set to true will output sql statements */
-       var $maxblobsize = 64000;       /*  maximum size of blobs or large text fields -- some databases die otherwise like foxpro */
-       var $concat_operator = '+'; /*  default concat operator -- change to || for Oracle/Interbase     */
-       var $fmtDate = "'Y-m-d'";       /*  used by DBDate() as the default date format used by the database */
-       var $fmtTimeStamp = "'Y-m-d, h:i:s A'"; /*  used by DBTimeStamp as the default timestamp fmt. */
-       var $true = '1';                        /*  string that represents TRUE for a database */
-       var $false = '0';                       /*  string that represents FALSE for a database */
-       var $replaceQuote = "\\'";      /*  string to use to replace quotes */
-    var $hasInsertID = false;  /*  supports autoincrement ID? */
-    var $hasAffectedRows = false;      /*  supports affected rows for update/delete? */
-    var $charSet=false;                /*  character set to use - only for interbase */
+       var $databaseType = '';         // RDBMS currently in use, eg. odbc, mysql, mssql                                       
+       var $database = '';                     // Name of database to be used. 
+       var $host = '';                         // The hostname of the database server  
+       var $user = '';                         // The username which is used to connect to the database server. 
+       var $password = '';             // Password for the username
+       var $debug = false;             // if set to true will output sql statements
+       var $maxblobsize = 64000;       // maximum size of blobs or large text fields -- some databases die otherwise like foxpro
+       var $concat_operator = '+'; // default concat operator -- change to || for Oracle/Interbase     
+       var $fmtDate = "'Y-m-d'";       // used by DBDate() as the default date format used by the database
+       var $fmtTimeStamp = "'Y-m-d, h:i:s A'"; // used by DBTimeStamp as the default timestamp fmt.
+       var $true = '1';                        // string that represents TRUE for a database
+       var $false = '0';                       // string that represents FALSE for a database
+       var $replaceQuote = "\\'";      // string to use to replace quotes
+    var $hasInsertID = false;  // supports autoincrement ID?
+    var $hasAffectedRows = false;      // supports affected rows for update/delete?
+    var $charSet=false;                // character set to use - only for interbase
        var $metaTablesSQL = '';
-       var $hasTop = false;            /*  support mssql/access SELECT TOP 10 * FROM TABLE */
-       var $hasLimit = false;          /*  support pgsql/mysql SELECT * FROM TABLE LIMIT 10 */
-       var $readOnly = false;          /*  this is a readonly database - used by phpLens */
-       var $hasMoveFirst = false;  /*  has ability to run MoveFirst(), scrolling backwards */
-       var $hasGenID = false;          /*  can generate sequences using GenID(); */
-       var $genID = 0;                         /*  sequence id used by GenID(); */
-       var $raiseErrorFn = false;      /*  error function to call */
-       var $upperCase = false;         /*  uppercase function to call for searching/where */
-       var $isoDates = false; /*  accepts dates in ISO format */
-       var $cacheSecs = 3600; /*  cache for 1 hour */
-       var $sysDate = false; /*  name of function that returns the current date */
-       var $sysTimeStamp = false; /*  name of function that returns the current timestamp */
+       var $hasTop = false;            // support mssql/access SELECT TOP 10 * FROM TABLE
+       var $hasLimit = false;          // support pgsql/mysql SELECT * FROM TABLE LIMIT 10
+       var $readOnly = false;          // this is a readonly database - used by phpLens
+       var $hasMoveFirst = false;  // has ability to run MoveFirst(), scrolling backwards
+       var $hasGenID = false;          // can generate sequences using GenID();
+       var $genID = 0;                         // sequence id used by GenID();
+       var $raiseErrorFn = false;      // error function to call
+       var $upperCase = false;         // uppercase function to call for searching/where
+       var $isoDates = false; // accepts dates in ISO format
+       var $cacheSecs = 3600; // cache for 1 hour
+       var $sysDate = false; // name of function that returns the current date
+       var $sysTimeStamp = false; // name of function that returns the current timestamp
        var $arrayClass = 'ADORecordSet_array';
-       /*  oracle specific stuff */
+       // oracle specific stuff
        var $noNullStrings = false;
        var $numCacheHits = 0;
        var $numCacheMisses = 0;
        var $pageExecuteCountRows = true;
-       var $uniqueSort = false; /*  indicates that all fields in order by must be unique */
+       var $uniqueSort = false; // indicates that all fields in order by must be unique
        
        /*
         * PRIVATE VARS
         */
-       var $_connectionID      = false;        /*  The returned link identifier whenever a successful database connection is made.     */ */
+       var $_connectionID      = false;        // The returned link identifier whenever a successful database connection is made.      */
                
-       var $_errorMsg = '';            /*  A variable which was used to keep the returned last error message.  The value will */
-                                       /* then returned by the errorMsg() function      */
+       var $_errorMsg = '';            // A variable which was used to keep the returned last error message.  The value will
+                                       //then returned by the errorMsg() function      
                                                
-       var $_queryID = false;          /*  This variable keeps the last created result link identifier.                */ */
+       var $_queryID = false;          // This variable keeps the last created result link identifier.         */
        
-       var $_isPersistentConnection = false;   /*  A boolean variable to state whether its a persistent connection or normal connection.       */ */
+       var $_isPersistentConnection = false;   // A boolean variable to state whether its a persistent connection or normal connection.        */
        
-       var $_bindInputArray = false; /*  set to true if ADOConnection.Execute() permits binding of array parameters. */
+       var $_bindInputArray = false; // set to true if ADOConnection.Execute() permits binding of array parameters.
        
-        var $autoCommit = true;        /*  do not modify this yourself - actually private */
+        var $autoCommit = true;        // do not modify this yourself - actually private
        
        /**
         * Constructor
        {
                if ($argHostname != "") $this->host = $argHostname;
                if ($argUsername != "") $this->user = $argUsername;
-               if ($argPassword != "") $this->password = $argPassword; /*  not stored for security reasons */
+               if ($argPassword != "") $this->password = $argPassword; // not stored for security reasons
                if ($argDatabaseName != "") $this->database = $argDatabaseName;         
                
                $this->_isPersistentConnection = false; 
        */
        function &LimitQuery($sql, $offset, $count)
        {
-               $rs = &$this->SelectLimit($sql, $count, $offset); /*  swap  */
+               $rs = &$this->SelectLimit($sql, $count, $offset); // swap 
                if (!$rs && defined('ADODB_PEAR')) return ADODB_PEAR_Error();
                return $rs;
        }
                        foreach($inputarr as $v) {
 
                                $sql .= $sqlarr[$i];
-                               /*  from Ron Baldwin <ron.baldwin@sourceprose.com> */
-                               /*  Only quote string types      */
+                               // from Ron Baldwin <ron.baldwin@sourceprose.com>
+                               // Only quote string types      
                                if (gettype($v) == 'string')
                                        $sql .= $this->qstr($v);
                                else if ($v === null)
                        $inputarr = false;
                }
                
-               /*  debug version of query */
+               // debug version of query
                if ($this->debug) {
                global $HTTP_SERVER_VARS;
                
                        if (is_array($sql)) $sqlTxt = $sql[0];
                        else $sqlTxt = $sql;
                        
-                       /*  check if running from browser or command-line */
+                       // check if running from browser or command-line
                        $inBrowser = isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']);
                        
                        if ($inBrowser)
                                because ErrorNo() calls Execute('SELECT @ERROR'), causing recure
                        */
                        if ($this->databaseType == 'mssql') { 
-                       /*  ErrorNo is a slow function call in mssql, and not reliable */
-                       /*  in PHP 4.0.6 */
+                       // ErrorNo is a slow function call in mssql, and not reliable
+                       // in PHP 4.0.6
                                if($emsg = $this->ErrorMsg()) {
                                        $err = $this->ErrorNo();
                                        if ($err) {
                                        flush();
                                }
                } else 
-                       /*  non-debug version of query */
+                       // non-debug version of query
                        $this->_queryID =@$this->_query($sql,$inputarr,$arg3);
                
-               /*  error handling if query fails */
+               // error handling if query fails
                if ($this->_queryID === false) {
                        if ($fn = $this->raiseErrorFn) {
                                $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,$inputarr);
                        }
                        return false;
                } else if ($this->_queryID === true){
-               /*  return simplified empty recordset for inserts/updates/deletes with lower overhead */
+               // return simplified empty recordset for inserts/updates/deletes with lower overhead
                        $rs = new ADORecordSet_empty();
                        return $rs;
                }
                
-               /*  return real recordset from select statement */
+               // return real recordset from select statement
                $rsclass = "ADORecordSet_".$this->databaseType;
-               $rs = new $rsclass($this->_queryID); /*  &new not supported by older PHP versions */
-               $rs->connection = &$this; /*  Pablo suggestion */
+               $rs = new $rsclass($this->_queryID); // &new not supported by older PHP versions
+               $rs->connection = &$this; // Pablo suggestion
                $rs->Init();
 
                if (is_array($sql)) $rs->sql = $sql[0];
        function GenID($seqname='adodbseq',$startID=1)
        {
                if (!$this->hasGenID) {
-                       return 0; /*  formerly returns false pre 1.60 */
+                       return 0; // formerly returns false pre 1.60
                }
                
                $getnext = sprintf($this->_genIDSQL,$seqname);
                        $rs = $this->Execute($getnext);
                }
                if ($rs && !$rs->EOF) $this->genID = (integer) reset($rs->fields);
-               else $this->genID = 0; /*  false */
+               else $this->genID = 0; // false
        
                if ($rs) $rs->Close();
 
        function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0)
        {
                if ($this->hasTop && $nrows > 0) {
-               /*  suggested by Reinhard Balling. Access requires top after distinct  */
+               // suggested by Reinhard Balling. Access requires top after distinct 
                
                        if ($offset <= 0) {
                                $sql = preg_replace(
         
                }
                
-               /*  if $offset>0, we want to skip rows, and $ADODB_COUNTRECS is set, we buffer  rows */
-               /*  0 to offset-1 which will be discarded anyway. So we disable $ADODB_COUNTRECS. */
+               // if $offset>0, we want to skip rows, and $ADODB_COUNTRECS is set, we buffer  rows
+               // 0 to offset-1 which will be discarded anyway. So we disable $ADODB_COUNTRECS.
                global $ADODB_COUNTRECS;
                
                $savec = $ADODB_COUNTRECS;
                if ($rs && !$rs->EOF) {
                        return $this->_rs2rs($rs,$nrows,$offset);
                }
-               /* print_r($rs); */
+               //print_r($rs);
                return $rs;
        }
        
                                $v = $this->qstr($v);
                                $fieldArray[$k] = $v;
                        }
-                       if (in_array($k,$keyCol)) continue; /*  skip UPDATE if is key */
+                       if (in_array($k,$keyCol)) continue; // skip UPDATE if is key
                        
                        if ($first) {
                                $first = false;                 
                if (!is_numeric($secs2cache)) {
                        if ($sql === false) $sql = -1;
                        if ($offset == -1) $offset = false;
-                                                 /*  sql,    nrows, offset,inputarr,arg3 */
+                                                 // sql,    nrows, offset,inputarr,arg3
                        return $this->SelectLimit($secs2cache,$sql,$nrows,$offset,$inputarr,$this->cacheSecs);
                }
                if ($sql === false) echo "Warning: \$sql missing from CacheSelectLimit()<br />\n";
        function CacheFlush($sql)
        {
                $f = $this->_gencachename($sql,false);
-               adodb_write_file($f,''); /*  is adodb_write_file needed? */
+               adodb_write_file($f,''); // is adodb_write_file needed?
                @unlink($f);
        }
        
                        $secs2cache = $this->cacheSecs;
                }
                include_once(ADODB_DIR.'/adodb-csvlib.inc.php');
-               /*  cannot cache if $inputarr set */
+               // cannot cache if $inputarr set
                if ($inputarr) return $this->Execute($sql, $inputarr, $arg3); 
                
                $md5file = $this->_gencachename($sql,true);
                }
                
                if (!$rs) {
-               /*  no cached rs found */
+               // no cached rs found
                        if ($this->debug) print " $md5file cache failure: $err<br>\n";
                        $rs = &$this->Execute($sql,$inputarr,$arg3);
                        if ($rs) {
                                $eof = $rs->EOF;
-                               $rs = &$this->_rs2rs($rs); /*  read entire recordset into memory immediately */
-                               $txt = _rs2serialize($rs,false,$sql); /*  serialize */
+                               $rs = &$this->_rs2rs($rs); // read entire recordset into memory immediately
+                               $txt = _rs2serialize($rs,false,$sql); // serialize
                
                                if (!adodb_write_file($md5file,$txt,$this->debug)) {
                                        if ($fn = $this->raiseErrorFn) {
                                }
                                if ($rs->EOF && !$eof) {
                                        $rs->MoveFirst();
-                                       /* $rs = &csv2rs($md5file,$err);                 */
-                                       $rs->connection = &$this; /*  Pablo suggestion */
+                                       //$rs = &csv2rs($md5file,$err);         
+                                       $rs->connection = &$this; // Pablo suggestion
                                }  
                                
                        } else
                                @unlink($md5file);
                } else { 
-               /*  ok, set cached object found */
-                       $rs->connection = &$this; /*  Pablo suggestion */
+               // ok, set cached object found
+                       $rs->connection = &$this; // Pablo suggestion
                        if ($this->debug){ 
                                $ttl = $rs->timeCreated + $secs2cache - time();
                                print " $md5file reloaded, ttl=$ttl<br>\n";
        */
        function CharMax()
        {
-               return 255; /*  make it conservative if not defined */
+               return 255; // make it conservative if not defined
        }
        
        
        */
        function TextMax()
        {
-               return 4000; /*  make it conservative if not defined */
+               return 4000; // make it conservative if not defined
        }
        
        
        {
                return $this->_close();
                
-               /*  "Simon Lee" <simon@mediaroad.com> reports that persistent connections need  */
-               /*  to be closed too! */
-               /* if ($this->_isPersistentConnection != true) return $this->_close(); */
-               /* else return true;     */
+               // "Simon Lee" <simon@mediaroad.com> reports that persistent connections need 
+               // to be closed too!
+               //if ($this->_isPersistentConnection != true) return $this->_close();
+               //else return true;     
        }
        
        
                        if ($rs === false) return false;
 
                        $retarr = array();
-                       while (!$rs->EOF) { /* print_r($rs->fields); */
+                       while (!$rs->EOF) { //print_r($rs->fields);
                                $fld = new ADOFieldObject();
                                $fld->name = $rs->fields[0];
                                $fld->type = $rs->fields[1];
                        ($v), $rr)) return false;
 
                if ($rr[1] <= TIMESTAMP_FIRST_YEAR) return 0;
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return mktime(0,0,0,$rr[2],$rr[3],$rr[1]);
        }
        
                        ($v), $rr)) return false;
                if ($rr[1] <= TIMESTAMP_FIRST_YEAR && $rr[2]<= 1) return 0;
        
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return  @mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1]);
        }
        
                        return  "'".str_replace("'",$this->replaceQuote,$s)."'";
                }
                
-               /*  undo magic quotes for " */
+               // undo magic quotes for "
                $s = str_replace('\\"','"',$s);
                
-               if ($this->replaceQuote == "\\'")  /*  ' already quoted, no need to change anything */
+               if ($this->replaceQuote == "\\'")  // ' already quoted, no need to change anything
                        return "'$s'";
-               else {/*  change \' to '' for sybase/mssql */
+               else {// change \' to '' for sybase/mssql
                        $s = str_replace('\\\\','\\',$s);
                        return "'".str_replace("\\'",$this->replaceQuote,$s)."'";
                }
                return $this->PageExecute($sql,$nrows,$page,$inputarr,$arg3,$secs2cache);
        }
 
-} /*  end class ADOConnection */
+} // end class ADOConnection
        
        
        
-       /* ==============================================================================================        */
-       /*  CLASS ADOFetchObj */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CLASS ADOFetchObj
+       //==============================================================================================        
                
        /**
        * Internal placeholder for record objects. Used by ADORecordSet->FetchObj().
        class ADOFetchObj {
        };
        
-       /* ==============================================================================================        */
-       /*  CLASS ADORecordSet_empty */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CLASS ADORecordSet_empty
+       //==============================================================================================        
        
        /**
        * Lightweight recordset when there are no records to be returned
                function FieldCount(){ return 0;}
        }
        
-       /* ==============================================================================================        */
-       /*  CLASS ADORecordSet */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CLASS ADORecordSet
+       //==============================================================================================        
        
        /**
         * RecordSet class that represents the dataset returned by the database.
         * public variables     
         */
        var $dataProvider = "native";
-       var $fields = false;    /*  holds the current row data */
-       var $blobSize = 64;     /*  any varchar/char field this size or greater is treated as a blob */
-                                                       /*  in other words, we use a text area for editting. */
-       var $canSeek = false;   /*  indicates that seek is supported */
-       var $sql;                               /*  sql text */
+       var $fields = false;    // holds the current row data
+       var $blobSize = 64;     // any varchar/char field this size or greater is treated as a blob
+                                                       // in other words, we use a text area for editting.
+       var $canSeek = false;   // indicates that seek is supported
+       var $sql;                               // sql text
        var $EOF = false;               /* Indicates that the current record position is after the last record in a Recordset object. */
        
-       var $emptyTimeStamp = '&nbsp;'; /*  what to display when $time==0 */
-       var $emptyDate = '&nbsp;'; /*  what to display when $time==0 */
+       var $emptyTimeStamp = '&nbsp;'; // what to display when $time==0
+       var $emptyDate = '&nbsp;'; // what to display when $time==0
        var $debug = false;
-       var $timeCreated=0;     /*  datetime in Unix format rs created -- for cached recordsets */
+       var $timeCreated=0;     // datetime in Unix format rs created -- for cached recordsets
 
-       var $bind = false;              /*  used by Fields() to hold array - should be private? */
-       var $fetchMode;                 /*  default fetch mode */
-       var $connection = false; /*  the parent connection */
+       var $bind = false;              // used by Fields() to hold array - should be private?
+       var $fetchMode;                 // default fetch mode
+       var $connection = false; // the parent connection
        /*
         *      private variables       
         */
                                }
                        }
                } else {
-                       /*  return scalar values */
+                       // return scalar values
                        if ($numIndex) {
                                while (!$this->EOF) {
-                               /*  some bug in mssql PHP 4.02 -- doesn't handle references properly so we FORCE creating a new string */
+                               // some bug in mssql PHP 4.02 -- doesn't handle references properly so we FORCE creating a new string
                                        $results[trim(($this->fields[0]))] = $this->fields[1];
                                        $this->MoveNext();
                                }
                        } else {
                                while (!$this->EOF) {
-                               /*  some bug in mssql PHP 4.02 -- doesn't handle references properly so we FORCE creating a new string */
+                               // some bug in mssql PHP 4.02 -- doesn't handle references properly so we FORCE creating a new string
                                        $v1 = trim(reset($this->fields));
                                        $v2 = ''.next($this->fields); 
                                        $results[$v1] = $v2;
        function UserTimeStamp($v,$fmt='Y-m-d H:i:s')
        {
                $tt = $this->UnixTimeStamp($v);
-               /*  $tt == -1 if pre TIMESTAMP_FIRST_YEAR */
+               // $tt == -1 if pre TIMESTAMP_FIRST_YEAR
                if (($tt === false || $tt == -1) && $v != false) return $v;
                if ($tt == 0) return $this->emptyTimeStamp;
                
        function UserDate($v,$fmt='Y-m-d')
        {
                $tt = $this->UnixDate($v);
-               /*  $tt == -1 if pre TIMESTAMP_FIRST_YEAR */
+               // $tt == -1 if pre TIMESTAMP_FIRST_YEAR
                if (($tt === false || $tt == -1) && $v != false) return $v;
                else if ($tt == 0) return $this->emptyDate;
-               else if ($tt == -1) { /*  pre-TIMESTAMP_FIRST_YEAR */
+               else if ($tt == -1) { // pre-TIMESTAMP_FIRST_YEAR
                }
                return date($fmt,$tt);
        
                        ($v), $rr)) return false;
                        
                if ($rr[1] <= 1903) return 0;
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return mktime(0,0,0,$rr[2],$rr[3],$rr[1]);
        }
        
                        ($v), $rr)) return false;
                if ($rr[1] <= 1903 && $rr[2]<= 1) return 0;
        
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return  @mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1]);
        }
        
                if ($this->EOF) return (defined('PEAR_ERROR_RETURN')) ? new PEAR_Error('EOF',-1): false;
                $arr = $this->fields;
                $this->MoveNext();
-               return 1; /*  DB_OK */
+               return 1; // DB_OK
        }
        
        
                                $this->_currentRow = $rowNumber;
                                if ($this->_fetch()) {
                                        $this->EOF = false;     
-                                   /*   $this->_currentRow += 1;                        */
+                                   //  $this->_currentRow += 1;                        
                                        return true;
                                }
                        } else 
         */
        function Close() 
        {
-               /*  free connection object - this seems to globally free the object */
-               /*  and not merely the reference, so don't do this... */
-               /*  $this->connection = false;  */
+               // free connection object - this seems to globally free the object
+               // and not merely the reference, so don't do this...
+               // $this->connection = false; 
                if (!$this->_closed) {
                        $this->_closed = true;
                        return $this->_close();         
     function PO_RecordCount($table="", $condition="") {
         
         $lnumrows = $this->_numOfRows;
-       /*  the database doesn't support native recordcount, so we do a workaround */
+       // the database doesn't support native recordcount, so we do a workaround
         if ($lnumrows == -1 && $this->connection) {
             IF ($table) {
                 if ($condition) $condition = " WHERE " . $condition; 
         */
        function &FetchField($fieldoffset) 
        {
-               /*  must be defined by child class */
+               // must be defined by child class
        }       
        
        /**
                if ($status != false) $this->_atLastPage = $status;
                return $this->_atLastPage;
        }
-} /*  end class ADORecordSet */
+} // end class ADORecordSet
        
-       /* ==============================================================================================        */
-       /*  CLASS ADORecordSet_array */
-       /* ==============================================================================================        */
+       //==============================================================================================        
+       // CLASS ADORecordSet_array
+       //==============================================================================================        
        
        /**
         * This class encapsulates the concept of a recordset created in memory
        {
                var $databaseType = "array";
        
-               var $_array;    /*  holds the 2-dimensional data array */
-               var $_types;    /*  the array of types of each column (C B I L M) */
-               var $_colnames; /*  names of each column in array */
-               var $_skiprow1; /*  skip 1st row because it holds column names */
-               var $_fieldarr; /*  holds array of field objects */
+               var $_array;    // holds the 2-dimensional data array
+               var $_types;    // the array of types of each column (C B I L M)
+               var $_colnames; // names of each column in array
+               var $_skiprow1; // skip 1st row because it holds column names
+               var $_fieldarr; // holds array of field objects
                var $canSeek = true;
                var $affectedrows = false;
                var $insertid = false;
                {
                global $ADODB_FETCH_MODE;
                
-                       $this->ADORecordSet($fakeid); /*  fake queryID           */
+                       $this->ADORecordSet($fakeid); // fake queryID           
                        $this->fetchMode = $ADODB_FETCH_MODE;
                }
                
                        $o =  new ADOFieldObject();
                        $o->name = $this->_colnames[$fieldOffset];
                        $o->type =  $this->_types[$fieldOffset];
-                       $o->max_length = -1; /*  length not known */
+                       $o->max_length = -1; // length not known
                        
                        return $o;
                }
                        return true;    
                }
        
-       } /*  ADORecordSet_array */
+       } // ADORecordSet_array
 
-       /* ==============================================================================================        */
-       /*  HELPER FUNCTIONS */
-       /* ==============================================================================================                        */
+       //==============================================================================================        
+       // HELPER FUNCTIONS
+       //==============================================================================================                        
        
     /**
         * Synonym for ADOLoadCode.
        */
        function adodb_write_file($filename, $contents,$debug=false)
        { 
-       # http:/* www.php.net/bugs.php?id=9203 Bug that flock fails on Windows */
+       # http://www.php.net/bugs.php?id=9203 Bug that flock fails on Windows
        # So to simulate locking, we assume that rename is an atomic operation.
        # First we delete $filename, then we create a $tempfile write to it and 
        # rename to the desired $filename. If the rename works, then we successfully 
        # 3. adodb reads stale file because unlink fails -- ok, $rs timeout occurs
        # 4. another process creates $filename between unlink() and rename() -- ok, rename() fails and  cache updated
                if (strpos(strtoupper(PHP_OS),'WIN') !== false) {
-                       /*  skip the decimal place */
+                       // skip the decimal place
                        $mtime = substr(str_replace(' ','_',microtime()),2); 
-                       /*  unlink will let some latencies develop, so uniqid() is more random */
+                       // unlink will let some latencies develop, so uniqid() is more random
                        @unlink($filename);
-                       /*  getmypid() actually returns 0 on Win98 - never mind! */
+                       // getmypid() actually returns 0 on Win98 - never mind!
                        $tmpname = $filename.uniqid($mtime).getmypid();
                        if (!($fd = fopen($tmpname,'a'))) return false;
                        $ok = ftruncate($fd,0);                 
                return $ok;
     }
 
-} /*  defined */
+} // defined
 ?>
\ No newline at end of file
index a84b6371b039184396a434a81f0a8051955c8e4e..deb9c22347d912a6074415aad1c631f611bc9628 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/*      Session Encryption by Ari Kuorikoski <ari.kuorikoski@finebyte.com> */
+//     Session Encryption by Ari Kuorikoski <ari.kuorikoski@finebyte.com>
 class MD5Crypt{
         function keyED($txt,$encrypt_key){
                 $encrypt_key = md5($encrypt_key);
index 21bdb78b6b7e1d315c4a2306ecac98b588bfd70e..0e5074308e14250e0c1da5ecf009c1359186e708 100644 (file)
@@ -18,10 +18,10 @@ if (!defined('_ADODB_ODBC_LAYER')) {
        
 class  ADODB_access extends ADODB_odbc {       
        var $databaseType = 'access';
-       var $hasTop = 'top';            /*  support mssql SELECT TOP 10 * FROM TABLE */
+       var $hasTop = 'top';            // support mssql SELECT TOP 10 * FROM TABLE
        var $fmtDate = "#Y-m-d#";
-       var $fmtTimeStamp = "#Y-m-d h:i:sA#"; /*  note not comma */
-       var $_bindInputArray = false; /*  strangely enough, setting to true does not work reliably */
+       var $fmtTimeStamp = "#Y-m-d h:i:sA#"; // note not comma
+       var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
        var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
        var $sysTimeStamp = 'NOW';
        
@@ -66,5 +66,5 @@ class  ADORecordSet_access extends ADORecordSet_odbc {
                return $this->ADORecordSet_odbc($id);
        }
 }
-} /*  class */
+} // class
 ?>
\ No newline at end of file
index 83c822bfa55d416f7d67c90d880ab596870cec7f..f458d1fe02f3e2a64727641bfba6ce495aef7214 100644 (file)
@@ -19,15 +19,15 @@ class ADODB_ado extends ADOConnection {
        var $_bindInputArray = false;
        var $fmtDate = "'Y-m-d'";
        var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
-       var $replaceQuote = "''"; /*  string to use to replace quotes */
+       var $replaceQuote = "''"; // string to use to replace quotes
        var $dataProvider = "ado";      
     var $hasAffectedRows = true;
-       var $adoParameterType = 201; /*  201 = long varchar, 203=long wide varchar, 205 = long varbinary */
+       var $adoParameterType = 201; // 201 = long varchar, 203=long wide varchar, 205 = long varbinary
        var $_affectedRows = false;
        var $_thisTransactions;
        var $_inTransaction = 0;
-       var $_cursor_type = 3; /*  3=adOpenStatic,0=adOpenForwardOnly,1=adOpenKeyset,2=adOpenDynamic */
-       var $_cursor_location = 3; /*  2=adUseServer, 3 = adUseClient; */
+       var $_cursor_type = 3; // 3=adOpenStatic,0=adOpenForwardOnly,1=adOpenKeyset,2=adOpenDynamic
+       var $_cursor_location = 3; // 2=adUseServer, 3 = adUseClient;
        var $_lock_type = -1;
        var $_execute_option = -1;
                       
@@ -42,9 +42,9 @@ class ADODB_ado extends ADOConnection {
             return $this->_affectedRows;
     }
     
-       /*  you can also pass a connection string like this: */
-       /*  */
-       /*  $DB->Connect('USER ID=sa;PASSWORD=pwd;SERVER=mangrove;DATABASE=ai',false,false,'SQLOLEDB'); */
+       // you can also pass a connection string like this:
+       //
+       // $DB->Connect('USER ID=sa;PASSWORD=pwd;SERVER=mangrove;DATABASE=ai',false,false,'SQLOLEDB');
        function _connect($argHostname, $argUsername, $argPassword, $argProvider= 'MSDASQL')
        {
                $u = 'UID';
@@ -55,17 +55,17 @@ class ADODB_ado extends ADOConnection {
 
                /* special support if provider is mssql or access */
                if ($argProvider=='mssql') {
-                       $u = 'User Id';  /* User parameter name for OLEDB */
+                       $u = 'User Id';  //User parameter name for OLEDB
                        $p = 'Password'; 
-                       $argProvider = "SQLOLEDB"; /*  SQL Server Provider */
+                       $argProvider = "SQLOLEDB"; // SQL Server Provider
                        
-                       /*  not yet */
-                       /* if ($argDatabasename) $argHostname .= ";Initial Catalog=$argDatabasename"; */
+                       // not yet
+                       //if ($argDatabasename) $argHostname .= ";Initial Catalog=$argDatabasename";
                        
-                       /* use trusted conection for SQL if username not specified */
+                       //use trusted conection for SQL if username not specified
                        if (!$argUsername) $argHostname .= ";Trusted_Connection=Yes";
                } else if ($argProvider=='access')
-                       $argProvider = "Microsoft.Jet.OLEDB.4.0"; /*  Microsoft Jet Provider */
+                       $argProvider = "Microsoft.Jet.OLEDB.4.0"; // Microsoft Jet Provider
                
                if ($argProvider) $dbc->Provider = $argProvider;        
                
@@ -73,7 +73,7 @@ class ADODB_ado extends ADOConnection {
                if ($argPassword)$argHostname .= ";$p=$argPassword";
                
                if ($this->debug) print "<p>Host=".$argHostname."<BR>version=$dbc->version</p>";
-               /*  @ added below for php 4.0.1 and earlier */
+               // @ added below for php 4.0.1 and earlier
                @$dbc->Open((string) $argHostname);
                
                $this->_connectionID = $dbc;
@@ -82,7 +82,7 @@ class ADODB_ado extends ADOConnection {
                return  $dbc->State > 0;
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argHostname, $argUsername, $argPassword, $argProvider='MSDASQL')
        {
                return $this->_connect($argHostname,$argUsername,$argPassword,$argProvider);
@@ -135,15 +135,15 @@ class ADODB_ado extends ADOConnection {
                $arr= array();
                $dbc = $this->_connectionID;
                
-               $adors=@$dbc->OpenSchema(20);/* tables */
+               $adors=@$dbc->OpenSchema(20);//tables
                if ($adors){
-                       $f = $adors->Fields(2);/* table/view name */
-                       $t = $adors->Fields(3);/* table type */
+                       $f = $adors->Fields(2);//table/view name
+                       $t = $adors->Fields(3);//table type
                        while (!$adors->EOF){
                                $tt=substr($t->value,0,6);
                                if ($tt!='SYSTEM' && $tt !='ACCESS')
                                        $arr[]=$f->value;
-                               /* print $f->value . ' ' . $t->value.'<br>'; */
+                               //print $f->value . ' ' . $t->value.'<br>';
                                $adors->MoveNext();
                        }
                        $adors->Close();
@@ -158,10 +158,10 @@ class ADODB_ado extends ADOConnection {
                $arr= array();
                $dbc = $this->_connectionID;
                
-               $adors=@$dbc->OpenSchema(4);/* tables */
+               $adors=@$dbc->OpenSchema(4);//tables
        
                if ($adors){
-                       $t = $adors->Fields(2);/* table/view name */
+                       $t = $adors->Fields(2);//table/view name
                        while (!$adors->EOF){
                                
                                
@@ -170,7 +170,7 @@ class ADODB_ado extends ADOConnection {
                                        $fld = new ADOFieldObject();
                                        $c = $adors->Fields(3);
                                        $fld->name = $c->Value;
-                                       $fld->type = 'CHAR'; /*  cannot discover type in ADO! */
+                                       $fld->type = 'CHAR'; // cannot discover type in ADO!
                                        $fld->max_length = -1;
                                        $arr[strtoupper($fld->name)]=$fld;
                                }
@@ -189,7 +189,7 @@ class ADODB_ado extends ADOConnection {
                
                $dbc = $this->_connectionID;
                
-       /*      return rs        */
+       //      return rs       
                if ($inputarr) {
                        $oCmd = new COM('ADODB.Command');
                        $oCmd->ActiveConnection = $dbc;
@@ -197,10 +197,10 @@ class ADODB_ado extends ADOConnection {
                        $oCmd->CommandType = 1;
 
                        foreach($inputarr as $val) {
-                               /*  name, type, direction 1 = input, len, */
+                               // name, type, direction 1 = input, len,
                                $this->adoParameterType = 130;
                                $p = $oCmd->CreateParameter('name',$this->adoParameterType,1,strlen($val),$val);
-                               /* print $p->Type.' '.$p->value; */
+                               //print $p->Type.' '.$p->value;
                                $oCmd->Parameters->Append($p);
                        }
                        $p = false;
@@ -220,7 +220,7 @@ class ADODB_ado extends ADOConnection {
                if ($dbc->Errors->Count > 0) return false;
                if (! $rs) return false;
                
-               if ($rs->State == 0) return true; /*  0 = adStateClosed means no records returned */
+               if ($rs->State == 0) return true; // 0 = adStateClosed means no records returned
                return $rs;
        }
 
@@ -269,7 +269,7 @@ class ADODB_ado extends ADOConnection {
                return $err->NativeError;
        }
 
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                if ($this->_connectionID) $this->_connectionID->Close();
@@ -289,8 +289,8 @@ class ADORecordSet_ado extends ADORecordSet {
        var $bind = false;
        var $databaseType = "ado";      
        var $dataProvider = "ado";      
-       var $_tarr = false; /*  caches the types */
-       var $_flds; /*  and field objects */
+       var $_tarr = false; // caches the types
+       var $_flds; // and field objects
     var $canSeek = true;
        var $hideErrors = true;
              
@@ -303,9 +303,9 @@ class ADORecordSet_ado extends ADORecordSet {
        }
 
 
-       /*  returns the field object */
+       // returns the field object
        function FetchField($fieldOffset = -1) {
-               $off=$fieldOffset+1; /*  offsets begin at 1 */
+               $off=$fieldOffset+1; // offsets begin at 1
                
                $o= new ADOFieldObject();
                $rs = $this->_queryID;
@@ -317,7 +317,7 @@ class ADORecordSet_ado extends ADORecordSet {
                $o->ado_type = $t;
                
 
-               /* print "off=$off name=$o->name type=$o->type len=$o->max_length<br>"; */
+               //print "off=$off name=$o->name type=$o->type len=$o->max_length<br>";
                return $o;
        }
        
@@ -347,15 +347,15 @@ class ADORecordSet_ado extends ADORecordSet {
        }
        
        
-     /*  should only be used to move forward as we normally use forward-only cursors */
+     // should only be used to move forward as we normally use forward-only cursors
        function _seek($row)
        {
        $rs = $this->_queryID; 
-        /*  absoluteposition doesn't work -- my maths is wrong ? */
-        /*     $rs->AbsolutePosition->$row-2; */
-        /*     return true; */
+        // absoluteposition doesn't work -- my maths is wrong ?
+        //    $rs->AbsolutePosition->$row-2;
+        //    return true;
         if ($this->_currentRow > $row) return false;
-        @$rs->Move((integer)$row - $this->_currentRow-1); /* adBookmarkFirst */
+        @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst
                return true;
        }
        
@@ -447,15 +447,15 @@ class ADORecordSet_ado extends ADORecordSet {
                
                switch ($t) {
                case 0:
-               case 12: /*  variant */
-               case 8: /*  bstr */
-               case 129: /* char */
-               case 130: /* wc */
-               case 200: /*  varc */
-               case 202:/*  varWC */
-               case 128: /*  bin */
-               case 204: /*  varBin */
-               case 72: /*  guid */
+               case 12: // variant
+               case 8: // bstr
+               case 129: //char
+               case 130: //wc
+               case 200: // varc
+               case 202:// varWC
+               case 128: // bin
+               case 204: // varBin
+               case 72: // guid
                        if ($len <= $this->blobSize) return 'C';
                
                case 201:
@@ -473,20 +473,20 @@ class ADORecordSet_ado extends ADORecordSet {
                
                case 11: return 'L';
                
-               case 16:/*      adTinyInt       = 16, */
-               case 2:/* adSmallInt    = 2, */
-               case 3:/* adInteger     = 3, */
-               case 4:/* adBigInt      = 20, */
-               case 17:/* adUnsignedTinyInt    = 17, */
-               case 18:/* adUnsignedSmallInt   = 18, */
-               case 19:/* adUnsignedInt        = 19, */
-               case 20:/* adUnsignedBigInt     = 21, */
+               case 16://      adTinyInt       = 16,
+               case 2://adSmallInt     = 2,
+               case 3://adInteger      = 3,
+               case 4://adBigInt       = 20,
+               case 17://adUnsignedTinyInt     = 17,
+               case 18://adUnsignedSmallInt    = 18,
+               case 19://adUnsignedInt = 19,
+               case 20://adUnsignedBigInt      = 21,
                        return 'I';
                default: return 'N';
                }
        }
        
-       /*  time stamp not supported yet */
+       // time stamp not supported yet
        function _fetch()
        {       
                $rs = $this->_queryID;
@@ -501,32 +501,32 @@ class ADORecordSet_ado extends ADORecordSet {
                                $flds[] = $f;
                                $tarr[] = $f->Type;
                        }
-                       /*  bind types and flds only once */
+                       // bind types and flds only once
                        $this->_tarr = $tarr; 
                        $this->_flds = $flds;
                }
                $t = reset($this->_tarr);
                $f = reset($this->_flds);
                
-               if ($this->hideErrors)  $olde = error_reporting(E_ERROR|E_CORE_ERROR);/*  sometimes $f->value be null */
+               if ($this->hideErrors)  $olde = error_reporting(E_ERROR|E_CORE_ERROR);// sometimes $f->value be null
                for ($i=0,$max = $this->_numOfFields; $i < $max; $i++) {
 
                        switch($t) {
-                       case 135: /*  timestamp */
+                       case 135: // timestamp
                                $this->fields[] = date('Y-m-d H:i:s',(integer)$f->value);
                                break;
                                
-                       case 133:/*  A date value (yyyymmdd)  */
+                       case 133:// A date value (yyyymmdd) 
                                $val = $f->value;
                                $this->fields[] = substr($val,0,4).'-'.substr($val,4,2).'-'.substr($val,6,2);
                                break;
-                       case 7: /*  adDate */
+                       case 7: // adDate
                                $this->fields[] = date('Y-m-d',(integer)$f->value);
                                break;
-                       case 1: /*  null */
+                       case 1: // null
                                $this->fields[] = false;
                                break;
-                       case 6: /*  currency is not supported properly; */
+                       case 6: // currency is not supported properly;
                                print '<br><b>'.$f->Name.': currency type not supported by PHP</b><br>';
                                $this->fields[] = (float) $f->value;
                                break;
@@ -534,12 +534,12 @@ class ADORecordSet_ado extends ADORecordSet {
                                $this->fields[] = $f->value; 
                                break;
                        }
-                       /* print " $f->value $t, "; */
+                       //print " $f->value $t, ";
                        $f = next($this->_flds);
                        $t = next($this->_tarr);
-               } /*  for */
+               } // for
                if ($this->hideErrors) error_reporting($olde);
-               @$rs->MoveNext(); /*  @ needed for some versions of PHP! */
+               @$rs->MoveNext(); // @ needed for some versions of PHP!
                
                if ($this->fetchMode == ADODB_FETCH_ASSOC) {
                        $this->fields = $this->GetRowAssoc(false);
@@ -550,7 +550,7 @@ class ADORecordSet_ado extends ADORecordSet {
        
        function _close() {
                $this->_flds = false;
-               @$this->_queryID->Close();/*  by Pete Dishman (peterd@telephonetics.co.uk) */
+               @$this->_queryID->Close();// by Pete Dishman (peterd@telephonetics.co.uk)
                $this->_queryID = false;        
        }
 
index ead40536ffc1f4c82cb21df120e8eb306d19a970..338d2e71630ea5602b0d5d5fa7c27ab6cbcda297 100644 (file)
@@ -17,9 +17,9 @@ if (!defined('_ADODB_ADO_LAYER')) {
 
 class  ADODB_ado_access extends ADODB_ado {    
        var $databaseType = 'ado_access';
-       var $hasTop = 'top';            /*  support mssql SELECT TOP 10 * FROM TABLE */
+       var $hasTop = 'top';            // support mssql SELECT TOP 10 * FROM TABLE
        var $fmtDate = "#Y-m-d#";
-       var $fmtTimeStamp = "#Y-m-d h:i:sA#";/*  note no comma */
+       var $fmtTimeStamp = "#Y-m-d h:i:sA#";// note no comma
        var $sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
        var $sysTimeStamp = 'NOW';
        
index 400545a8c317eada07071c69904d6ecf8ed142e9..11440727229e96f7c2b0c3a1b6311f09d8d0bc61 100644 (file)
@@ -24,7 +24,7 @@ class  ADODB_ado_mssql extends ADODB_ado {
        var $hasTop = 'top';
        var $sysDate = 'GetDate()';
        var $sysTimeStamp = 'GetDate()';
-       /* var $_inTransaction = 1; // always open recordsets, so no transaction problems. */
+       //var $_inTransaction = 1; // always open recordsets, so no transaction problems.
        
        function ADODB_ado_mssql()
        {
index 5c295a30bc7f93ffd1182f0a48a8b2283eec94af..6a6f4b127576fda3a46778957e9c8574c6264dea 100644 (file)
@@ -22,11 +22,11 @@ class ADODB_borland_ibase extends ADODB_ibase {
                $this->ADODB_ibase();
        }
        
-       /*  Note that Interbase 6.5 uses ROWS instead - don't you love forking wars! */
-       /*              SELECT col1, col2 FROM table ROWS 5 -- get 5 rows  */
-       /*              SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2 */
-       /*  Firebird uses */
-       /*              SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE */
+       // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars!
+       //              SELECT col1, col2 FROM table ROWS 5 -- get 5 rows 
+       //              SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
+       // Firebird uses
+       //              SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE
        function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false,$secs=0)
        {
                if ($nrows > 0) {
@@ -37,9 +37,9 @@ class ADODB_borland_ibase extends ADODB_ibase {
                                $str = " ROWS $a TO $b";
                        }
                } else {
-                       /*  ok, skip  */
+                       // ok, skip 
                        $a = $offset + 1;
-                       $str = " ROWS $a TO 999999999"; /*  999 million */
+                       $str = " ROWS $a TO 999999999"; // 999 million
                }
                $sql .= $str;
                
index 672cc6f5d6f4ece0697e9215eb8c987af166fdf0..38b679c5a9d94b427e979e29613b37a6ad756c8f 100644 (file)
@@ -24,7 +24,7 @@ class ADODB_csv extends ADOConnection {
        var $_affectedrows=0;
        var $_insertid=0;
        var $_url;
-       var $replaceQuote = "''"; /*  string to use to replace quotes */
+       var $replaceQuote = "''"; // string to use to replace quotes
        
        function ADODB_csv() 
        {                       
@@ -46,18 +46,18 @@ class ADODB_csv extends ADOConnection {
        }
 
        
-       /*  returns true or false */
+       // returns true or false
        function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
-               if (strtolower(substr($argHostname,0,7)) !== 'http:/* ') return false; */
+               if (strtolower(substr($argHostname,0,7)) !== 'http://') return false;
                $this->_url = $argHostname;
                return true;    
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
-               if (strtolower(substr($argHostname,0,7)) !== 'http:/* ') return false; */
+               if (strtolower(substr($argHostname,0,7)) !== 'http://') return false;
                $this->_url = $argHostname;
                return true;
        }
@@ -68,7 +68,7 @@ class ADODB_csv extends ADOConnection {
        }
                
                
-       /*  parameters use PostgreSQL convention, not MySQL */
+       // parameters use PostgreSQL convention, not MySQL
        function &SelectLimit($sql,$nrows=-1,$offset=-1,$arg3=false)
        {
        global $ADODB_FETCH_MODE;
@@ -100,7 +100,7 @@ class ADODB_csv extends ADOConnection {
                return $rs;
        }
        
-       /*  returns queryID or false */
+       // returns queryID or false
        function &Execute($sql,$inputarr=false,$arg3=false)
        {
        global $ADODB_FETCH_MODE;
@@ -112,8 +112,8 @@ class ADODB_csv extends ADOConnection {
                        foreach($inputarr as $v) {
 
                                $sql .= $sqlarr[$i];
-                               /*  from Ron Baldwin <ron.baldwin@sourceprose.com> */
-                               /*  Only quote string types      */
+                               // from Ron Baldwin <ron.baldwin@sourceprose.com>
+                               // Only quote string types      
                                if (gettype($v) == 'string')
                                        $sql .= $this->qstr($v);
                                else if ($v === null)
@@ -170,12 +170,12 @@ class ADODB_csv extends ADOConnection {
                return $this->_errorNo;
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                return true;
        }
-} /*  class */
+} // class
 
 class ADORecordset_csv extends ADORecordset {
        function ADORecordset_csv($id)
@@ -189,6 +189,6 @@ class ADORecordset_csv extends ADORecordset {
        }
 }
 
-} /*  define */
+} // define
        
 ?>
\ No newline at end of file
index 66f85f85ba1c4437013d1c8944a64e4b771e5690..a667666f5a4827445567b95f3d8c65fc899eb6cd 100644 (file)
@@ -69,15 +69,15 @@ class ADODB_DB2 extends ADODB_odbc {
        var $concat_operator = 'CONCAT';
        var $sysDate = 'CURRENT DATE';
        var $sysTimeStamp = 'CURRENT TIMESTAMP';
-       /* var $curmode = SQL_CUR_USE_ODBC; */
+       //var $curmode = SQL_CUR_USE_ODBC;
        
        function ADODB_DB2()
        {
                $this->ADODB_odbc();
        }
 
-       /*  returns true or false */
-       /*  curmode is not properly supported by DB2 odbc driver according to Mark Newnham */
+       // returns true or false
+       // curmode is not properly supported by DB2 odbc driver according to Mark Newnham
        function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
        {
        global $php_errormsg;
@@ -86,11 +86,11 @@ class ADODB_DB2 extends ADODB_odbc {
                $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword);
                $this->_errorMsg = $php_errormsg;
 
-               /* if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); */
+               //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
                return $this->_connectionID != false;
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
        {
        global $php_errormsg;
@@ -98,7 +98,7 @@ class ADODB_DB2 extends ADODB_odbc {
                $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword);
                $this->_errorMsg = $php_errormsg;
                
-               /* if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); */
+               //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
                return $this->_connectionID != false;
        }
        
@@ -111,7 +111,7 @@ class ADODB_DB2 extends ADODB_odbc {
        function &SelectLimit($sql,$nrows=-1,$offset=-1,$arg3=false)
        {
                if ($offset <= 0) {
-               /*  could also use " OPTIMIZE FOR $nrows ROWS " */
+               // could also use " OPTIMIZE FOR $nrows ROWS "
                        $sql .=  " FETCH FIRST $nrows ROWS ONLY ";
                        return $this->Execute($sql,false,$arg3);
                } else {
@@ -144,7 +144,7 @@ class  ADORecordSet_db2 extends ADORecordSet_odbc {
                case 'LONGCHAR':
                case 'TEXT':
                case 'CLOB':
-               case 'DBCLOB': /*  double-byte */
+               case 'DBCLOB': // double-byte
                        return 'X';
                
                case 'BLOB':
@@ -159,12 +159,12 @@ class  ADORecordSet_db2 extends ADORecordSet_odbc {
                case 'TIMESTAMP':
                        return 'T';
                
-               /* case 'BOOLEAN':  */
-               /* case 'BIT': */
-               /*      return 'L'; */
+               //case 'BOOLEAN': 
+               //case 'BIT':
+               //      return 'L';
                        
-               /* case 'COUNTER': */
-               /*      return 'R'; */
+               //case 'COUNTER':
+               //      return 'R';
                        
                case 'INT':
                case 'INTEGER':
@@ -177,5 +177,5 @@ class  ADORecordSet_db2 extends ADORecordSet_odbc {
        }
 }
 
-} /* define */
+} //define
 ?>
\ No newline at end of file
index c1a04b30a05f3294ad64ac2829c81f085acdba85..0551cccd187036e249bf00b6cd76f95afacebdac 100644 (file)
@@ -47,7 +47,7 @@ class ADODB_fbsql extends ADOConnection {
                return $arr;
        }
 
-       /*  returns concatenated string */
+       // returns concatenated string
        function Concat()
        {
                $s = "";
@@ -64,7 +64,7 @@ class ADODB_fbsql extends ADOConnection {
                else return '';
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $this->_connectionID = fbsql_connect($argHostname,$argUsername,$argPassword);
@@ -73,7 +73,7 @@ class ADODB_fbsql extends ADOConnection {
                return true;    
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $this->_connectionID = fbsql_pconnect($argHostname,$argUsername,$argPassword);
@@ -96,7 +96,7 @@ class ADODB_fbsql extends ADOConnection {
                                $fld->name = $rs->fields[0];
                                $fld->type = $rs->fields[1];
                                        
-                               /*  split type into type(length): */
+                               // split type into type(length):
                                if (preg_match("/^(.+)\((\d+)\)$/", $fld->type, $query_array)) {
                                        $fld->type = $query_array[1];
                                        $fld->max_length = $query_array[2];
@@ -117,7 +117,7 @@ class ADODB_fbsql extends ADOConnection {
                return false;
        }
                
-       /*  returns true or false */
+       // returns true or false
        function SelectDB($dbName) 
        {
                $this->databaseName = $dbName;
@@ -128,7 +128,7 @@ class ADODB_fbsql extends ADOConnection {
        }
        
        
-       /*  returns queryID or false */
+       // returns queryID or false
        function _query($sql,$inputarr)
        {
                return fbsql_query("$sql;",$this->_connectionID);
@@ -147,7 +147,7 @@ class ADODB_fbsql extends ADOConnection {
                return @fbsql_errno($this->_connectionID);
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                return @fbsql_close($this->_connectionID);
@@ -188,13 +188,13 @@ class ADORecordSet_fbsql extends ADORecordSet{
        function &FetchField($fieldOffset = -1) {
                if ($fieldOffset != -1) {
                        $o =  @fbsql_fetch_field($this->_queryID, $fieldOffset);
-                       /* $o->max_length = -1; // fbsql returns the max length less spaces -- so it is unrealiable */
+                       //$o->max_length = -1; // fbsql returns the max length less spaces -- so it is unrealiable
                        $f = @fbsql_field_flags($this->_queryID,$fieldOffset);
                        $o->binary = (strpos($f,'binary')!== false);
                }
                else if ($fieldOffset == -1) {  /*      The $fieldOffset argument is not provided thus its -1   */
-                       $o = @fbsql_fetch_field($this->_queryID);/*  fbsql returns the max length less spaces -- so it is unrealiable */
-                       /* $o->max_length = -1; */
+                       $o = @fbsql_fetch_field($this->_queryID);// fbsql returns the max length less spaces -- so it is unrealiable
+                       //$o->max_length = -1;
                }
                
                return $o;
@@ -217,7 +217,7 @@ class ADORecordSet_fbsql extends ADORecordSet{
        
        function MetaType($t,$len=-1,$fieldobj=false)
        {
-               $len = -1; /*  fbsql max_length is not accurate */
+               $len = -1; // fbsql max_length is not accurate
                switch (strtoupper($t)) {
                case 'CHARACTER':
                case 'CHARACTER VARYING': 
@@ -227,7 +227,7 @@ class ADORecordSet_fbsql extends ADORecordSet{
                case 'BIT VARYING': 
                        if ($len <= $this->blobSize) return 'C';
                        
-               /*  so we have to check whether binary... */
+               // so we have to check whether binary...
                case 'IMAGE':
                case 'LONGBLOB': 
                case 'BLOB':
@@ -254,6 +254,6 @@ class ADORecordSet_fbsql extends ADORecordSet{
                }
        }
 
-} /* class */
-} /*  defined */
+} //class
+} // defined
 ?>
\ No newline at end of file
index a0d528ac4f79e5c157c7d870bb29b884a2698f62..f1b2919ab5a1981b5013535477ff645648d8f60f 100644 (file)
@@ -21,9 +21,9 @@ class ADODB_firebird extends ADODB_ibase {
                $this->ADODB_ibase();
        }
        
-       /*  Note that Interbase 6.5 uses this ROWS instead - don't you love forking wars! */
-       /*              SELECT col1, col2 FROM table ROWS 5 -- get 5 rows  */
-       /*              SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2 */
+       // Note that Interbase 6.5 uses this ROWS instead - don't you love forking wars!
+       //              SELECT col1, col2 FROM table ROWS 5 -- get 5 rows 
+       //              SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
        function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false,$secs=0)
        {
                $str = 'SELECT ';
index 8e83f1f5aefcd8599c4b0d2bc00b5aeca07291d8..72c3149827dcbe615009fede0e4cbdea9d3ec59c 100644 (file)
@@ -25,7 +25,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
 
 class ADODB_ibase extends ADOConnection {
     var $databaseType = "ibase";
-    var $replaceQuote = "\'"; /*  string to use to replace quotes */
+    var $replaceQuote = "\'"; // string to use to replace quotes
     var $fmtDate = "'Y-m-d'";
     var $fmtTimeStamp = "'Y-m-d, H:i:s'";
     var $concat_operator='||';
@@ -49,7 +49,7 @@ class ADODB_ibase extends ADOConnection {
     function BeginTrans()
        {     
         $this->autoCommit = false;
-       $this->_transactionID = $this->_connectionID;/* ibase_trans($this->ibasetrans, $this->_connectionID); */
+       $this->_transactionID = $this->_connectionID;//ibase_trans($this->ibasetrans, $this->_connectionID);
            return $this->_transactionID;
        }
        
@@ -59,7 +59,7 @@ class ADODB_ibase extends ADOConnection {
                $ret = false;
                $this->autoCommit = true;
                if ($this->_transactionID) {
-                               /* print ' commit '; */
+                               //print ' commit ';
                        $ret = ibase_commit($this->_transactionID);
                }
                $this->_transactionID = false;
@@ -77,11 +77,11 @@ class ADODB_ibase extends ADOConnection {
                return $ret;
        }
        
-       /*  See http://community.borland.com/article/0,1410,25844,00.html */
+       // See http://community.borland.com/article/0,1410,25844,00.html
        function RowLock($tables,$where,$col)
        {
                if ($this->autoCommit) $this->BeginTrans();
-               $this->Execute("UPDATE $table SET $col=$col WHERE $where "); /*  is this correct - jlim? */
+               $this->Execute("UPDATE $table SET $col=$col WHERE $where "); // is this correct - jlim?
                return 1;
        }
        
@@ -102,7 +102,7 @@ class ADODB_ibase extends ADOConnection {
                        $rs = $this->Execute($getnext);
                }
                if ($rs && !$rs->EOF) $this->genID = (integer) reset($rs->fields);
-               else $this->genID = 0; /*  false */
+               else $this->genID = 0; // false
                
                if ($rs) $rs->Close();
                
@@ -127,13 +127,13 @@ class ADODB_ibase extends ADOConnection {
             return $this->_errorMsg;
     }
 
-       /*  returns true or false */
+       // returns true or false
     function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
     {  
-               /* if ($this->charSet !== false) */
+               //if ($this->charSet !== false)
                        $this->_connectionID = ibase_connect($argHostname,$argUsername,$argPassword,$this->charSet,$this->buffers,$this->dialect);
-         /*   else         */
-               /*      $this->_connectionID = ibase_connect($argHostname,$argUsername,$argPassword); */
+         //  else        
+               //      $this->_connectionID = ibase_connect($argHostname,$argUsername,$argPassword);
                        
                if ($this->_connectionID === false) {
                        $this->_handleerror();
@@ -142,13 +142,13 @@ class ADODB_ibase extends ADOConnection {
        
         return true;
     }
-       /*  returns true or false */
+       // returns true or false
     function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
     {
-               /* if ($this->charSet !== false) */
+               //if ($this->charSet !== false)
                        $this->_connectionID = ibase_pconnect($argHostname,$argUsername,$argPassword,$this->charSet,$this->buffers,$this->dialect);
-         /*   else         */
-               /*      $this->_connectionID = ibase_pconnect($argHostname,$argUsername,$argPassword); */
+         //  else        
+               //      $this->_connectionID = ibase_pconnect($argHostname,$argUsername,$argPassword);
                             
            if ($this->_connectionID === false) {
                        $this->_handleerror();
@@ -166,8 +166,8 @@ class ADODB_ibase extends ADOConnection {
                return array($sql,$stmt);
        }
 
-       /*  returns query ID if successful, otherwise false */
-          /*  there have been reports of problems with nested queries - the code is probably not re-entrant? */
+       // returns query ID if successful, otherwise false
+          // there have been reports of problems with nested queries - the code is probably not re-entrant?
     function _query($sql,$iarr=false)
     { 
                if (is_array($sql)) {
@@ -203,14 +203,14 @@ class ADODB_ibase extends ADOConnection {
        return $ret;
     }
 
-     /*  returns true or false */
+     // returns true or false
      function _close()
      {       
         if (!$this->autoCommit) @ibase_rollback($this->_connectionID);
         return @ibase_close($this->_connectionID);
      }
        
-        /*  returns array of ADOFieldObjects for current table */
+        // returns array of ADOFieldObjects for current table
        function &MetaColumns($table) 
        {
        global $ADODB_FETCH_MODE;
@@ -226,7 +226,7 @@ class ADODB_ibase extends ADOConnection {
                        if ($rs === false) return false;
 
                        $retarr = array();
-                       while (!$rs->EOF) { /* print_r($rs->fields); */
+                       while (!$rs->EOF) { //print_r($rs->fields);
                                $fld = new ADOFieldObject();
                                $fld->name = $rs->fields[0];
                                $tt = $rs->fields[1];
@@ -259,7 +259,7 @@ class ADODB_ibase extends ADOConnection {
                return false;
        }
        
-       /*  no longer needed in php 4.1.0, but still backward compatible */
+       // no longer needed in php 4.1.0, but still backward compatible
        function &BlobEncode( $blob ) 
        {
                $blobid = ibase_blob_create( $this->_connectionID);
@@ -267,11 +267,11 @@ class ADODB_ibase extends ADOConnection {
                return ibase_blob_close( $blobid );
        }
        
-       /*  no longer needed in php 4.1.0, but still backward compatible */
+       // no longer needed in php 4.1.0, but still backward compatible
        function &BlobDecode( $blob ) 
        {
                $blobid = ibase_blob_open( $blob );
-               $realblob = ibase_blob_get( $blobid,MAX_BLOB_SIZE); /*  2nd param is max size of blob -- Kevin Boillet <kevinboillet@yahoo.fr> */
+               $realblob = ibase_blob_get( $blobid,MAX_BLOB_SIZE); // 2nd param is max size of blob -- Kevin Boillet <kevinboillet@yahoo.fr>
                ibase_blob_close( $blobid );
 
                return( $realblob );
@@ -393,9 +393,9 @@ class ADORecordset_ibase extends ADORecordSet
                case 'TIMESTAMP':
                case 'DATE': return 'D';
                        
-                       /* case 'T': return 'T'; */
+                       //case 'T': return 'T';
        
-                       /* case 'L': return 'L'; */
+                       //case 'L': return 'L';
                        case 'INT': 
                        case 'SHORT':
                        case 'INTEGER': return 'I';
index f47e5edc6bc2a5d844220a542a8fe112ec985e52..3118b1b7fbed48bc092ec4b96a0dc4551f325136 100644 (file)
@@ -17,7 +17,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim. All rights reserved.
 class ADODB_informix72 extends ADOConnection {
        var $databaseType = "informix72";
        var $dataProvider = "informix";
-       var $replaceQuote = "''"; /*  string to use to replace quotes */
+       var $replaceQuote = "''"; // string to use to replace quotes
        var $fmtDate = "'Y-m-d'";
        var $fmtTimeStamp = "'Y-m-d H:i:s'";
        var $hasInsertID = true;
@@ -30,17 +30,17 @@ class ADODB_informix72 extends ADOConnection {
        var $has_insertid = true;
 
        var $_autocommit = true;
-       var $_bindInputArray = true;  /*  set to true if ADOConnection.Execute() permits binding of array parameters. */
+       var $_bindInputArray = true;  // set to true if ADOConnection.Execute() permits binding of array parameters.
        var $sysDate = 'TODAY';
        var $sysTimeStamp = 'CURRENT';
    
        function ADODB_informix72()
        {
 
-               /*  alternatively, use older method: */
-               /* putenv("DBDATE=Y4MD-"); */
+               // alternatively, use older method:
+               //putenv("DBDATE=Y4MD-");
 
-               /*  force ISO date format */
+               // force ISO date format
                putenv('GL_DATE=%Y-%m-%d');
        }
 
@@ -104,7 +104,7 @@ class ADODB_informix72 extends ADOConnection {
    }
 
 
-       /*  returns true or false */
+       // returns true or false
    function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $dbs = $argDatabasename . "@" . $argHostname;
@@ -114,7 +114,7 @@ class ADODB_informix72 extends ADOConnection {
                return true;
        }
 
-       /*  returns true or false */
+       // returns true or false
    function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $dbs = $argDatabasename . "@" . $argHostname;
@@ -132,12 +132,12 @@ class ADODB_informix72 extends ADOConnection {
                else return array($sql,$stmt);
        }
 */
-       /*  returns query ID if successful, otherwise false */
+       // returns query ID if successful, otherwise false
        function _query($sql,$inputarr)
        {
        global $ADODB_COUNTRECS;
        
-      /*  String parameters have to be converted using ifx_create_char */
+      // String parameters have to be converted using ifx_create_char
       if ($inputarr) {
          foreach($inputarr as $v) {
             if (gettype($v) == 'string') {
@@ -149,8 +149,8 @@ class ADODB_informix72 extends ADOConnection {
          }
       }
 
-      /*  In case of select statement, we use a scroll cursor in order */
-      /*  to be able to call "move", or "movefirst" statements */
+      // In case of select statement, we use a scroll cursor in order
+      // to be able to call "move", or "movefirst" statements
       if ($ADODB_COUNTRECS && preg_match("/^[\\t\\n ]*select/i", $sql)) {
          if ($inputarr) {
             $this->lastQuery = ifx_query($sql,$this->_connectionID, IFX_SCROLL, $tab);
@@ -168,15 +168,15 @@ class ADODB_informix72 extends ADOConnection {
          }
       }
 
-      /*  Following line have been commented because autocommit mode is */
-      /*  not supported by informix SE 7.2 */
+      // Following line have been commented because autocommit mode is
+      // not supported by informix SE 7.2
 
-      /* if ($this->_autocommit) ifx_query('COMMIT',$this->_connectionID); */
+      //if ($this->_autocommit) ifx_query('COMMIT',$this->_connectionID);
 
                return $this->lastQuery;
        }
 
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                $this->lastQuery = false;
@@ -216,7 +216,7 @@ class ADORecordset_informix72 extends ADORecordSet {
                        foreach($fp as $k => $v) {
                                $o = new ADOFieldObject;
                                $o->name = $k;
-                               $arr = split(';',$v); /* "SQLTYPE;length;precision;scale;ISNULLABLE" */
+                               $arr = split(';',$v); //"SQLTYPE;length;precision;scale;ISNULLABLE"
                                $o->type = $arr[0];
                                $o->max_length = $arr[1];
                                $this->_fieldprops[] = $o;
@@ -227,7 +227,7 @@ class ADORecordset_informix72 extends ADORecordSet {
 
        function _initrs()
        {
-           $this->_numOfRows = -1; /*  ifx_affected_rows not reliable, only returns estimate -- ($ADODB_COUNTRECS)? ifx_affected_rows($this->_queryID):-1; */
+           $this->_numOfRows = -1; // ifx_affected_rows not reliable, only returns estimate -- ($ADODB_COUNTRECS)? ifx_affected_rows($this->_queryID):-1;
                $this->_numOfFields = ifx_num_fields($this->_queryID);
        }
 
index d8a7763028baafd5687bb12393b91b9f46c0ed84..57d52e8c4a8a478962836b685f2deb85964ae789 100644 (file)
@@ -14,31 +14,31 @@ Set tabs to 4 for best viewing.
        
 */
 
-/* ---------------------------------------------------------------- */
-/*  MSSQL returns dates with the format Oct 13 2002 or 13 Oct 2002 */
-/*  and this causes tons of problems because localized versions of  */
-/*  MSSQL will return the dates in dmy or  mdy order; and also the  */
-/*  month strings depends on what language has been configured. The  */
-/*  following two variables allow you to control the localization */
-/*  settings - Ugh. */
-/*  */
-/*  MORE LOCALIZATION INFO */
-/*  ---------------------- */
-/*  To configure datetime, look for and modify sqlcommn.loc,  */
-/*     typically found in c:\mssql\install */
-/*  Also read : */
-/*      http://support.microsoft.com/default.aspx?scid=kb;EN-US;q220918 */
-/*  Alternatively use: */
-/*        CONVERT(char(12),datecol,120) */
-/* ---------------------------------------------------------------- */
+//----------------------------------------------------------------
+// MSSQL returns dates with the format Oct 13 2002 or 13 Oct 2002
+// and this causes tons of problems because localized versions of 
+// MSSQL will return the dates in dmy or  mdy order; and also the 
+// month strings depends on what language has been configured. The 
+// following two variables allow you to control the localization
+// settings - Ugh.
+//
+// MORE LOCALIZATION INFO
+// ----------------------
+// To configure datetime, look for and modify sqlcommn.loc, 
+//     typically found in c:\mssql\install
+// Also read :
+//      http://support.microsoft.com/default.aspx?scid=kb;EN-US;q220918
+// Alternatively use:
+//        CONVERT(char(12),datecol,120)
+//----------------------------------------------------------------
 
-global $ADODB_mssql_date_order; /*  'dmy' and 'mdy' supported */
+global $ADODB_mssql_date_order; // 'dmy' and 'mdy' supported
 
 $ADODB_mssql_has_datetimeconvert = (strnatcmp(PHP_VERSION,'4.2.0')>=0);
 if ($ADODB_mssql_has_datetimeconvert) {
        ini_set('mssql.datetimeconvert',0); 
 } else {
-global $ADODB_mssql_mths;              /*  array, months must be upper-case */
+global $ADODB_mssql_mths;              // array, months must be upper-case
 global $ADODB_mssql_has_datetimeconvert;
 
        $ADODB_mssql_date_order = 'mdy'; 
@@ -46,9 +46,9 @@ global $ADODB_mssql_has_datetimeconvert;
                'JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,
                'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);
 }
-/* --------------------------------------------------------------------------- */
-/*  Call this to autoset $ADODB_mssql_date_order at the beginning of your code, */
-/*  just after you connect to the database. Supports mdy and dmy only */
+//---------------------------------------------------------------------------
+// Call this to autoset $ADODB_mssql_date_order at the beginning of your code,
+// just after you connect to the database. Supports mdy and dmy only
 function AutoDetect_MSSQL_Date_Order($conn)
 {
 global $ADODB_mssql_date_order;
@@ -69,14 +69,14 @@ global $ADODB_mssql_date_order;
 
 class ADODB_mssql extends ADOConnection {
        var $databaseType = "mssql";    
-       var $replaceQuote = "''"; /*  string to use to replace quotes */
+       var $replaceQuote = "''"; // string to use to replace quotes
        var $fmtDate = "'Y-m-d'";
        var $fmtTimeStamp = "'Y-m-d h:i:sA'";
        var $hasInsertID = true;
     var $hasAffectedRows = true;
        var $metaTablesSQL="select name from sysobjects where type='U' or type='V' and (name not in ('sysallocations','syscolumns','syscomments','sysdepends','sysfilegroups','sysfiles','sysfiles1','sysforeignkeys','sysfulltextcatalogs','sysindexes','sysindexkeys','sysmembers','sysobjects','syspermissions','sysprotects','sysreferences','systypes','sysusers','sysalternates','sysconstraints','syssegments','REFERENTIAL_CONSTRAINTS','CHECK_CONSTRAINTS','CONSTRAINT_TABLE_USAGE','CONSTRAINT_COLUMN_USAGE','VIEWS','VIEW_TABLE_USAGE','VIEW_COLUMN_USAGE','SCHEMATA','TABLES','TABLE_CONSTRAINTS','TABLE_PRIVILEGES','COLUMNS','COLUMN_DOMAIN_USAGE','COLUMN_PRIVILEGES','DOMAINS','DOMAIN_CONSTRAINTS','KEY_COLUMN_USAGE'))";
        var $metaColumnsSQL = "select c.name,t.name,c.length from syscolumns c join systypes t on t.xusertype=c.xusertype join sysobjects o on o.id=c.id where o.name='%s'";
-       var $hasTop = 'top';            /*  support mssql SELECT TOP 10 * FROM TABLE */
+       var $hasTop = 'top';            // support mssql SELECT TOP 10 * FROM TABLE
        var $_hastrans = false;
        var $hasGenID = true;
        var $sysDate = 'GetDate()';
@@ -91,12 +91,12 @@ class ADODB_mssql extends ADOConnection {
                $this->_has_mssql_init = (strnatcmp(PHP_VERSION,'4.1.0')>=0);   
        }
 
-    /*  might require begintrans -- committrans */
+    // might require begintrans -- committrans
     function _insertid()
     {
             return $this->GetOne('select @@identity');
     }
-      /*  might require begintrans -- committrans */
+      // might require begintrans -- committrans
     function _affectedrows()
     {
         return $this->GetOne('select @@rowcount');
@@ -111,7 +111,7 @@ class ADODB_mssql extends ADOConnection {
                
        function GenID($seq='adodbseq',$start=1)
        {       
-               /* $this->debug=1; */
+               //$this->debug=1;
                $this->Execute('BEGIN TRANSACTION adodbseq');
                $ok = $this->Execute("update $seq with (tablock,holdlock) set id = id + 1");
                if (!$ok) {
@@ -128,8 +128,8 @@ class ADODB_mssql extends ADOConnection {
                $this->Execute('COMMIT TRANSACTION adodbseq'); 
                return $num;
                
-               /*  in old implementation, pre 1.90, we returned GUID... */
-               /* return $this->GetOne("SELECT CONVERT(varchar(255), NEWID()) AS 'Char'"); */
+               // in old implementation, pre 1.90, we returned GUID...
+               //return $this->GetOne("SELECT CONVERT(varchar(255), NEWID()) AS 'Char'");
        }
        
        function CommitTrans($ok=true) 
@@ -166,7 +166,7 @@ class ADODB_mssql extends ADOConnection {
                return $this->GetOne("select top 1 null as ignore from $tables with (ROWLOCK,HOLDLOCK) where $where");
        }
        
-       /* From: Fernando Moreira <FMoreira@imediata.pt> */
+       //From: Fernando Moreira <FMoreira@imediata.pt>
        function MetaDatabases() 
        { 
            if(@mssql_select_db("master")) { 
@@ -219,7 +219,7 @@ class ADODB_mssql extends ADOConnection {
        else return -1;
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $this->_connectionID = mssql_connect($argHostname,$argUsername,$argPassword);
@@ -229,7 +229,7 @@ class ADODB_mssql extends ADOConnection {
        }
        
        
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $this->_connectionID = mssql_pconnect($argHostname,$argUsername,$argPassword);
@@ -279,7 +279,7 @@ class ADODB_mssql extends ADOConnection {
                        return $sql;
                }
 
-               $isNull = is_null($var); /*  php 4.0.4 and above... */
+               $isNull = is_null($var); // php 4.0.4 and above...
                        
                if ($type === false) 
                        switch(gettype($var)) {
@@ -314,7 +314,7 @@ class ADODB_mssql extends ADOConnection {
                return $this->Execute($sql) != false;
        }
        
-       /*  returns query ID if successful, otherwise false */
+       // returns query ID if successful, otherwise false
        function _query($sql,$inputarr)
        {
                $this->_errorMsg = false;
@@ -322,7 +322,7 @@ class ADODB_mssql extends ADOConnection {
                return mssql_query($sql,$this->_connectionID);
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _close()
        { 
                if ($this->_hastrans) $this->RollbackTrans();
@@ -331,7 +331,7 @@ class ADODB_mssql extends ADOConnection {
                return $rez;
        }
        
-       /*  mssql uses a default date like Dec 30 2000 12:00AM */
+       // mssql uses a default date like Dec 30 2000 12:00AM
        function UnixDate($v)
        {
                return ADORecordSet_array_mssql::UnixDate($v);
@@ -351,7 +351,7 @@ class ADORecordset_mssql extends ADORecordSet {
 
        var $databaseType = "mssql";
        var $canSeek = true;
-       /*  _mths works only in non-localised system */
+       // _mths works only in non-localised system
                
        function ADORecordset_mssql($id)
        {
@@ -361,8 +361,8 @@ class ADORecordset_mssql extends ADORecordSet {
                return $this->ADORecordSet($id);
        }
 
-       /* Contributed by "Sven Axelsson" <sven.axelsson@bokochwebb.se> */
-       /*  get next resultset - requires PHP 4.0.5 or later */
+       //Contributed by "Sven Axelsson" <sven.axelsson@bokochwebb.se>
+       // get next resultset - requires PHP 4.0.5 or later
        function NextRecordSet()
        {
            if (!mssql_next_result($this->_queryID)) return false;
@@ -416,7 +416,7 @@ class ADORecordset_mssql extends ADORecordSet {
                return @mssql_data_seek($this->_queryID, $row);
        }
 
-       /*  speedup */
+       // speedup
        function MoveNext() 
        {
                if (!$this->EOF) {              
@@ -430,8 +430,8 @@ class ADORecordset_mssql extends ADORecordSet {
                return false;
        }
        
-       /*  INSERT UPDATE DELETE returns false even if no error occurs in 4.0.4 */
-       /*  also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot! */
+       // INSERT UPDATE DELETE returns false even if no error occurs in 4.0.4
+       // also the date format has been changed from YYYY-mm-dd to dd MMM YYYY in 4.0.4. Idiot!
        function _fetch($ignore_fields=false) 
        {
                if ($this->fetchMode & ADODB_FETCH_ASSOC) $this->fields = @mssql_fetch_array($this->_queryID);
@@ -447,7 +447,7 @@ class ADORecordset_mssql extends ADORecordSet {
                $this->_queryID = false;        
                return $rez;
        }
-       /*  mssql uses a default date like Dec 30 2000 12:00AM */
+       // mssql uses a default date like Dec 30 2000 12:00AM
        function UnixDate($v)
        {
                return ADORecordSet_array_mssql::UnixDate($v);
@@ -467,7 +467,7 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
                $this->ADORecordSet_array($id);
        }
        
-               /*  mssql uses a default date like Dec 30 2000 12:00AM */
+               // mssql uses a default date like Dec 30 2000 12:00AM
        function UnixDate($v)
        {
        global $ADODB_mssql_has_datetimeconvert;
@@ -475,7 +475,7 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
                
        global $ADODB_mssql_mths,$ADODB_mssql_date_order;
        
-               /* Dec 30 2000 12:00AM  */
+               //Dec 30 2000 12:00AM 
                if ($ADODB_mssql_date_order == 'dmy') {
                        if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4})|" ,$v, $rr)) {
                                return parent::UnixDate($v);
@@ -495,7 +495,7 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
                }
                $themth = $ADODB_mssql_mths[$themth];
                if ($themth <= 0) return false;
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return  mktime(0,0,0,$themth,$theday,$rr[3]);
        }
        
@@ -506,7 +506,7 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
                
        global $ADODB_mssql_mths,$ADODB_mssql_date_order;
        
-               /* Dec 30 2000 12:00AM */
+               //Dec 30 2000 12:00AM
                 if ($ADODB_mssql_date_order == 'dmy') {
                         if (!preg_match( "|^([0-9]{1,2})[-/\. ]+([A-Za-z]{3})[-/\. ]+([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})|"
                        ,$v, $rr)) return parent::UnixTimeStamp($v);
@@ -536,7 +536,7 @@ class ADORecordSet_array_mssql extends ADORecordSet_array {
                default:
                        break;
                }
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return  mktime($rr[4],$rr[5],0,$themth,$theday,$rr[3]);
        }
 }
index ce4ca9efa85557569987df6b47da590bd9b22a02..8ebd284ecf039433ef3247c3863672b744d3405f 100644 (file)
@@ -26,7 +26,7 @@ class ADODB_mysql extends ADOConnection {
        var $hasMoveFirst = true;
        var $hasGenID = true;
        var $upperCase = 'upper';
-       var $isoDates = true; /*  accepts dates in ISO format */
+       var $isoDates = true; // accepts dates in ISO format
        var $sysDate = 'CURDATE()';
        var $sysTimeStamp = 'NOW()';
        var $forceNewConnect = false;
@@ -45,15 +45,15 @@ class ADODB_mysql extends ADOConnection {
             return mysql_affected_rows($this->_connectionID);
     }
   
-       /*  See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html */
-       /*  Reference on Last_Insert_ID on the recommended way to simulate sequences */
+       // See http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
+       // Reference on Last_Insert_ID on the recommended way to simulate sequences
        var $_genIDSQL = "update %s set id=LAST_INSERT_ID(id+1);";
        var $_genSeqSQL = "create table %s (id int not null)";
        var $_genSeq2SQL = "insert into %s values (%s)";
        
        function GenID($seqname='adodbseq',$startID=1)
        {
-               /* if (!$this->hasGenID) return false; */
+               //if (!$this->hasGenID) return false;
                $getnext = sprintf($this->_genIDSQL,$seqname);
                $rs = @$this->Execute($getnext);
                if (!$rs) {
@@ -82,7 +82,7 @@ class ADODB_mysql extends ADOConnection {
                return $arr;
        }
 
-       /*  returns concatenated string */
+       // returns concatenated string
        function Concat()
        {
                $s = "";
@@ -96,13 +96,13 @@ class ADODB_mysql extends ADOConnection {
                        } else $s .= ','.$a;
                }*/
                
-               /*  suggestion by andrew005@mnogo.ru */
+               // suggestion by andrew005@mnogo.ru
                $s = implode(',',$arr); 
                if (strlen($s) > 0) return "CONCAT($s)";
                else return '';
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                if ($this->forceNewConnect && (strnatcmp(PHP_VERSION,'4.2.0')>=0))
@@ -114,7 +114,7 @@ class ADODB_mysql extends ADOConnection {
                return true;    
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
@@ -144,7 +144,7 @@ class ADODB_mysql extends ADOConnection {
                                $fld->name = $rs->fields[0];
                                $fld->type = $rs->fields[1];
                                        
-                               /*  split type into type(length): */
+                               // split type into type(length):
                                if (preg_match("/^(.+)\((\d+)\)$/", $fld->type, $query_array)) {
                                        $fld->type = $query_array[1];
                                        $fld->max_length = $query_array[2];
@@ -174,7 +174,7 @@ class ADODB_mysql extends ADOConnection {
                return false;
        }
                
-       /*  returns true or false */
+       // returns true or false
        function SelectDB($dbName) 
        {
                $this->databaseName = $dbName;
@@ -184,7 +184,7 @@ class ADODB_mysql extends ADOConnection {
                else return false;      
        }
        
-       /*  parameters use PostgreSQL convention, not MySQL */
+       // parameters use PostgreSQL convention, not MySQL
        function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $arg3=false,$secs=0)
        {
                $offsetStr =($offset>=0) ? "$offset," : '';
@@ -194,12 +194,12 @@ class ADODB_mysql extends ADOConnection {
                
        }
        
-       /*  returns queryID or false */
+       // returns queryID or false
        function _query($sql,$inputarr)
        {
        global $ADODB_COUNTRECS;
                if($ADODB_COUNTRECS) return mysql_query($sql,$this->_connectionID);
-               else return mysql_unbuffered_query($sql,$this->_connectionID); /*  requires PHP >= 4.0.6 */
+               else return mysql_unbuffered_query($sql,$this->_connectionID); // requires PHP >= 4.0.6
        }
 
        /*      Returns: the last error message from previous database operation        */      
@@ -219,7 +219,7 @@ class ADODB_mysql extends ADOConnection {
        
 
        
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                @mysql_close($this->_connectionID);
@@ -241,7 +241,7 @@ class ADODB_mysql extends ADOConnection {
                case 'T': return 'DATETIME';
                case 'L': return 'TINYINT';
                case 'R': return 'INTEGER NOT NULL AUTO_INCREMENT';
-               case 'I': return 'INTEGER';  /*  enough for 9 petabytes! */
+               case 'I': return 'INTEGER';  // enough for 9 petabytes!
                
                case 'F': return 'DOUBLE';
                case 'N': return 'NUMERIC';
@@ -305,14 +305,14 @@ class ADORecordSet_mysql extends ADORecordSet{
                if ($fieldOffset != -1) {
                        $o =  mysql_fetch_field($this->_queryID, $fieldOffset);
                        $f = @mysql_field_flags($this->_queryID,$fieldOffset);
-                       $o->max_length = @mysql_field_len($this->_queryID,$fieldOffset); /*  suggested by: Jim Nicholson (jnich@att.com) */
-                       /* $o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable */
+                       $o->max_length = @mysql_field_len($this->_queryID,$fieldOffset); // suggested by: Jim Nicholson (jnich@att.com)
+                       //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
                        $o->binary = (strpos($f,'binary')!== false);
                }
                else if ($fieldOffset == -1) {  /*      The $fieldOffset argument is not provided thus its -1   */
                        $o = @mysql_fetch_field($this->_queryID);
-                       $o->max_length = @mysql_field_len($this->_queryID); /*  suggested by: Jim Nicholson (jnich@att.com) */
-                       /* $o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable */
+                       $o->max_length = @mysql_field_len($this->_queryID); // suggested by: Jim Nicholson (jnich@att.com)
+                       //$o->max_length = -1; // mysql returns the max length less spaces -- so it is unrealiable
                }
                        
                return $o;
@@ -327,7 +327,7 @@ class ADORecordSet_mysql extends ADORecordSet{
        /* Use associative array to get fields array */
        function Fields($colname)
        {       
-               /*  added @ by "Michael William Miller" <mille562@pilot.msu.edu> */
+               // added @ by "Michael William Miller" <mille562@pilot.msu.edu>
                if ($this->fetchMode != MYSQL_NUM) return @$this->fields[$colname];
                
                if (!$this->bind) {
@@ -359,12 +359,12 @@ class ADORecordSet_mysql extends ADORecordSet{
                return false;
        } */
        
-       /*  10% speedup to move MoveNext to child class */
+       // 10% speedup to move MoveNext to child class
        function MoveNext() 
        {
                if (!$this->EOF) {              
                        $this->_currentRow++;
-                       /*  using & below slows things down by 20%! */
+                       // using & below slows things down by 20%!
                        $this->fields = @mysql_fetch_array($this->_queryID,$this->fetchMode);
                        
                        if (is_array($this->fields)) return true;
@@ -393,7 +393,7 @@ class ADORecordSet_mysql extends ADORecordSet{
        
        function MetaType($t,$len=-1,$fieldobj=false)
        {
-               $len = -1; /*  mysql max_length is not accurate */
+               $len = -1; // mysql max_length is not accurate
                switch (strtoupper($t)) {
                case 'STRING': 
                case 'CHAR':
@@ -409,8 +409,8 @@ class ADORecordSet_mysql extends ADORecordSet{
                case 'MEDIUMTEXT':
                        return 'X';
                        
-               /*  php_mysql extension always returns 'blob' even if 'text' */
-               /*  so we have to check whether binary... */
+               // php_mysql extension always returns 'blob' even if 'text'
+               // so we have to check whether binary...
                case 'IMAGE':
                case 'LONGBLOB': 
                case 'BLOB':
index 4fd7142b03978c1916f0dbe4ad7f7b05ea5f7267..255dbf2a4985250ec5bca2d1b4de820612352837 100644 (file)
@@ -35,14 +35,14 @@ You can also modify the date format using the ALTER SESSION command.
 class ADODB_oci8 extends ADOConnection {
     var $databaseType = 'oci8';
        var $dataProvider = 'oci8';
-    var $replaceQuote = "''"; /*  string to use to replace quotes */
+    var $replaceQuote = "''"; // string to use to replace quotes
     var $concat_operator='||';
        var $sysDate = "TRUNC(SYSDATE)";
        var $sysTimeStamp = 'SYSDATE';
        
        var $_stmt;
        var $_commit = OCI_COMMIT_ON_SUCCESS;
-       var $_initdate = true; /*  init date to YYYY-MM-DD */
+       var $_initdate = true; // init date to YYYY-MM-DD
        var $metaTablesSQL = "select table_name from cat where table_type in ('TABLE','VIEW')";
        var $metaColumnsSQL = "select cname,coltype,width from col where tname='%s' order by colno";
        var $_bindInputArray = true;
@@ -55,7 +55,7 @@ class ADODB_oci8 extends ADOConnection {
        var $connectSID = false;
        var $_bind = false;
        var $_hasOCIFetchStatement = false;
-       var $_getarray = false; /*  currently not working */
+       var $_getarray = false; // currently not working
        
     function ADODB_oci8() 
        {
@@ -67,7 +67,7 @@ class ADODB_oci8 extends ADOConnection {
                return OCIRowCount($this->_stmt);
        }
        
-       /*  format and return date string in database date format */
+       // format and return date string in database date format
        function DBDate($d)
        {
                if (empty($d) && $d !== 0) return 'null';
@@ -76,7 +76,7 @@ class ADODB_oci8 extends ADOConnection {
                return 'TO_DATE('.date($this->fmtDate,$d).",'YYYY-MM-DD')";
        }
        
-       /*  format and return date string in database timestamp format */
+       // format and return date string in database timestamp format
        function DBTimeStamp($ts)
        {
                if (empty($ts) && $ts !== 0) return 'null';
@@ -159,11 +159,11 @@ NATSOFT.DOMAIN =
     )
   )
 */
-    /*  returns true or false */
+    // returns true or false
     function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$persist=false)
     {
                         
-       if($argHostname) { /*  added by Jorma Tuomainen <jorma.tuomainen@ppoy.fi> */
+       if($argHostname) { // added by Jorma Tuomainen <jorma.tuomainen@ppoy.fi>
                if(strpos($argHostname,":")) {
                                $argHostinfo=explode(":",$argHostname);
                        $argHostname=$argHostinfo[0];
@@ -180,7 +180,7 @@ NATSOFT.DOMAIN =
                                .")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))";
        }
                                
-               /* if ($argHostname) print "<p>Connect: 1st argument should be left blank for $this->databaseType</p>"; */
+               //if ($argHostname) print "<p>Connect: 1st argument should be left blank for $this->databaseType</p>";
        if ($persist)$this->_connectionID = OCIPLogon($argUsername,$argPassword, $argDatabasename);
           else $this->_connectionID = OCILogon($argUsername,$argPassword, $argDatabasename);
           
@@ -189,10 +189,10 @@ NATSOFT.DOMAIN =
                        $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
                }
                
-               /* print OCIServerVersion($this->_connectionID); */
+               //print OCIServerVersion($this->_connectionID);
         return true;
        }
-        /*  returns true or false */
+        // returns true or false
     function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
         return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename,true);
@@ -215,7 +215,7 @@ NATSOFT.DOMAIN =
        */
        function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0)
        {
-               /*  seems that oracle only supports 1 hint comment in 8i */
+               // seems that oracle only supports 1 hint comment in 8i
                if (strpos($sql,'/*+') !== false)
                        $sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql);
                else
@@ -224,17 +224,17 @@ NATSOFT.DOMAIN =
                if ($offset < 100) {
                        if ($nrows > 0) {       
                                if ($offset > 0) $nrows += $offset;
-                               /* $inputarr['adodb_rownum'] = $nrows; */
+                               //$inputarr['adodb_rownum'] = $nrows;
                                $sql = "select * from ($sql) where rownum <= $nrows";
                                $nrows = -1;
                        }
-                       /*  note that $nrows = 0 still has to work ==> no rows returned */
+                       // note that $nrows = 0 still has to work ==> no rows returned
 
                        return ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$arg3,$secs2cache);
                } else {
-                        /*  Algorithm by Tomas V V Cox, from PEAR DB oci8.php */
+                        // Algorithm by Tomas V V Cox, from PEAR DB oci8.php
                
-                /*  Let Oracle return the name of the columns */
+                // Let Oracle return the name of the columns
                 $q_fields = "SELECT * FROM ($sql) WHERE NULL = NULL";
                 if (!$result = OCIParse($this->_connectionID, $q_fields)) {
                     return false;
@@ -250,7 +250,7 @@ NATSOFT.DOMAIN =
                         
                 $fields = implode(',', $cols);
                 $nrows += $offset;
-                        $offset += 1; /*  in Oracle rownum starts at 1 */
+                        $offset += 1; // in Oracle rownum starts at 1
                         
                 $sql = "SELECT $fields FROM".
                          "(SELECT rownum as adodb_rownum, $fields FROM".
@@ -348,7 +348,7 @@ NATSOFT.DOMAIN =
        static $BINDNUM = 0;
        
                $stmt = OCIParse($this->_connectionID,$sql);
-               if (!$stmt) return $sql; /*  error in statement, let Execute() handle the error */
+               if (!$stmt) return $sql; // error in statement, let Execute() handle the error
                
                $BINDNUM += 1;
                return array($sql,$stmt,0,$BINDNUM);
@@ -389,11 +389,11 @@ NATSOFT.DOMAIN =
                if (!is_array($stmt)) return false;
                if ($name == false) {
                        if ($type !== false) $rez = OCIBindByName($stmt[1],":".$name,$var,$size,$type);
-                       else $rez = OCIBindByName($stmt[1],":".$stmt[2],$var,$size); /*  +1 byte for null terminator */
+                       else $rez = OCIBindByName($stmt[1],":".$stmt[2],$var,$size); // +1 byte for null terminator
                        $stmt[2] += 1;
                } else {
                        if ($type !== false) $rez = OCIBindByName($stmt[1],":".$name,$var,$size,$type);
-                       else $rez = OCIBindByName($stmt[1],":".$name,$var,$size); /*  +1 byte for null terminator */
+                       else $rez = OCIBindByName($stmt[1],":".$name,$var,$size); // +1 byte for null terminator
                }
                
                return $rez;
@@ -440,18 +440,18 @@ NATSOFT.DOMAIN =
        */ 
        function _query($sql,$inputarr)
        {
-               if (is_array($sql)) { /*  is prepared sql */
+               if (is_array($sql)) { // is prepared sql
                        $stmt = $sql[1];
                        
-                       /*  we try to bind to permanent array, so that OCIBindByName is persistent */
-                       /*  and carried out once only - note that max array element size is 4000 chars */
+                       // we try to bind to permanent array, so that OCIBindByName is persistent
+                       // and carried out once only - note that max array element size is 4000 chars
                        if (is_array($inputarr)) {
                                $bindpos = $sql[3];
                                if (isset($this->_bind[$bindpos])) {
-                               /*  all tied up already */
+                               // all tied up already
                                        $bindarr = &$this->_bind[$bindpos];
                                } else {
-                               /*  one statement to bind them all */
+                               // one statement to bind them all
                                        $bindarr = array();
                                        foreach($inputarr as $k => $v) {
                                                $bindarr[$k] = $v;
@@ -471,16 +471,16 @@ NATSOFT.DOMAIN =
                if (is_array($inputarr)) {
                        foreach($inputarr as $k => $v) {
                                if (is_array($v)) {
-                                       if (sizeof($v) == 2) /*  suggested by g.giunta@libero. */
+                                       if (sizeof($v) == 2) // suggested by g.giunta@libero.
                                                OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1]);
                                        else
                                                OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
                                } else {
                                        $len = -1;
                                        if ($v === ' ') $len = 1;
-                                       if (isset($bindarr)) {  /*  is prepared sql, so no need to ocibindbyname again */
+                                       if (isset($bindarr)) {  // is prepared sql, so no need to ocibindbyname again
                                                $bindarr[$k] = $v;
-                                       } else {                                /*  dynamic sql, so rebind every time */
+                                       } else {                                // dynamic sql, so rebind every time
                                                OCIBindByName($stmt,":$k",$inputarr[$k],$len);
                                        }
                                }
@@ -495,7 +495,7 @@ NATSOFT.DOMAIN =
            return false;
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                if (!$this->autoCommit) OCIRollback($this->_connectionID);
@@ -506,7 +506,7 @@ NATSOFT.DOMAIN =
 
        function MetaPrimaryKeys($table)
        {
-       /*  tested with oracle 8.1.7 */
+       // tested with oracle 8.1.7
                $table = strtoupper($table);
                $sql = "SELECT /*+ RULE */ distinct b.column_name
    FROM ALL_CONSTRAINTS a
@@ -542,7 +542,7 @@ NATSOFT.DOMAIN =
                case 'T': return 'DATE';
                case 'L': return 'NUMBER(1)';
                case 'R': return false;
-               case 'I': return 'NUMBER(16)';  /*  enough for 9 petabytes! */
+               case 'I': return 'NUMBER(16)';  // enough for 9 petabytes!
                
                case 'F': return 'NUMBER';
                case 'N': return 'NUMBER';
@@ -584,12 +584,12 @@ NATSOFT.DOMAIN =
                        return  "'".str_replace("'",$this->replaceQuote,$s)."'";
                }
                
-               /*  undo magic quotes for " */
+               // undo magic quotes for "
                $s = str_replace('\\"','"',$s);
                
-               if ($this->replaceQuote == "\\'")  /*  ' already quoted, no need to change anything */
+               if ($this->replaceQuote == "\\'")  // ' already quoted, no need to change anything
                        return "'$s'";
-               else {/*  change \' to '' for sybase/mssql */
+               else {// change \' to '' for sybase/mssql
                        $s = str_replace('\\\\','\\',$s);
                        return "'".str_replace("\\'",$this->replaceQuote,$s)."'";
                }
@@ -606,7 +606,7 @@ class ADORecordset_oci8 extends ADORecordSet {
     var $databaseType = 'oci8';
        var $bind=false;
        var $_fieldobjs;
-       /* var $_arr = false; */
+       //var $_arr = false;
                
     function ADORecordset_oci8($queryID)
     {
@@ -670,7 +670,7 @@ class ADORecordset_oci8 extends ADORecordSet {
         $fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
         $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
                if ($fld->type == 'NUMBER') {
-                       /* $p = OCIColumnPrecision($this->_queryID, $fieldOffset); */
+                       //$p = OCIColumnPrecision($this->_queryID, $fieldOffset);
                        $sc = OCIColumnScale($this->_queryID, $fieldOffset);
                        if ($sc == 0) $fld->type = 'INT';
                }
@@ -692,7 +692,7 @@ class ADORecordset_oci8 extends ADORecordSet {
         */
        function GetArray($nRows = -1) 
        {
-       /*      if ($this->_arr) return $this->_arr; */
+       //      if ($this->_arr) return $this->_arr;
                $results = array();
                $cnt = 0;
                while (!$this->EOF && $nRows != $cnt) {
@@ -702,7 +702,7 @@ class ADORecordset_oci8 extends ADORecordSet {
                return $results;
        }
        
-       /*  10% speedup to move MoveNext to child class */
+       // 10% speedup to move MoveNext to child class
        function MoveNext() 
        {
                if (!$this->EOF) {              
@@ -795,7 +795,7 @@ class ADORecordset_oci8 extends ADORecordSet {
                case 'DATE': 
                        return 'D';
                
-                    /* case 'T': return 'T'; */
+                    //case 'T': return 'T';
                
                case 'INT': 
                case 'SMALLINT':
index 29ff582b619b11ef0f9aa82f91115cf3cf17af38..682c65ec6a69fa4b3fca992f47c4781480182fa0 100644 (file)
@@ -25,7 +25,7 @@ class ADODB_oci805 extends ADODB_oci8 {
        
        function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0)
        {
-               /*  seems that oracle only supports 1 hint comment in 8i */
+               // seems that oracle only supports 1 hint comment in 8i
                if (strpos($sql,'/*+') !== false)
                        $sql = str_replace('/*+ ','/*+FIRST_ROWS ',$sql);
                else
index ed4d0ec1ab7d391027fc8412d1ee010f2f12b68a..84d48fc91832b99f1e8ef962036e21dc71c90421 100644 (file)
@@ -33,7 +33,7 @@ class ADODB_oci8po extends ADODB_oci8 {
                return ADODB_oci8::Prepare($sql);
        }
        
-       /*  emulate handling of parameters ? ?, replacing with :bind0 :bind1 */
+       // emulate handling of parameters ? ?, replacing with :bind0 :bind1
        function _query($sql,$inputarr)
        {
                if (is_array($inputarr)) {
@@ -82,7 +82,7 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
                         return $this->fields[$this->bind[strtoupper($colname)]];
                }
        
-               /*  lowercase field names... */
+               // lowercase field names...
                function &_FetchField($fieldOffset = -1)
         {
                  $fld = new ADOFieldObject;
@@ -91,14 +91,14 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
                  $fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
                  $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
                                 if ($fld->type == 'NUMBER') {
-                                       /* $p = OCIColumnPrecision($this->_queryID, $fieldOffset); */
+                                       //$p = OCIColumnPrecision($this->_queryID, $fieldOffset);
                                        $sc = OCIColumnScale($this->_queryID, $fieldOffset);
                                        if ($sc == 0) $fld->type = 'INT';
                                 }
                  return $fld;
         }
 
-       /*  10% speedup to move MoveNext to child class */
+       // 10% speedup to move MoveNext to child class
        function MoveNext() 
        {
                if (!$this->EOF) {              
@@ -132,7 +132,7 @@ class ADORecordset_oci8po extends ADORecordset_oci8 {
                return $results;
        }
 
-       /*  Uggh - a useless slowdown */
+       // Uggh - a useless slowdown
        function _updatefields()
        {
                $arr = array();
index a80399a174b6674eb4427a7a0373ab6c1744e9df..28a88b30a3eb11a89d4ef8047f1bc83c8b8cde92 100644 (file)
@@ -20,13 +20,13 @@ class ADODB_odbc extends ADOConnection {
        var $databaseType = "odbc";     
        var $fmtDate = "'Y-m-d'";
        var $fmtTimeStamp = "'Y-m-d, h:i:sA'";
-       var $replaceQuote = "''"; /*  string to use to replace quotes */
+       var $replaceQuote = "''"; // string to use to replace quotes
        var $dataProvider = "odbc";
        var $hasAffectedRows = true;
        var $binmode = ODBC_BINMODE_RETURN;
-       /* var $longreadlen = 8000; // default number of chars to return for a Blob/Long field */
+       //var $longreadlen = 8000; // default number of chars to return for a Blob/Long field
        var $_bindInputArray = false;    
-       var $curmode = SQL_CUR_USE_DRIVER; /*  See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L */
+       var $curmode = SQL_CUR_USE_DRIVER; // See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L
        var $_genSeqSQL = "create table %s (id integer)";
        var $_autocommit = true;
        var $_haserrorfunctions = true;
@@ -54,8 +54,8 @@ class ADODB_odbc extends ADOConnection {
        */
        function GenID($seq='adodbseq',$start=1)
        {       
-               /*  if you have to modify the parameter below, your database is overloaded, */
-               /*  or you need to implement generation of id's yourself! */
+               // if you have to modify the parameter below, your database is overloaded,
+               // or you need to implement generation of id's yourself!
                $MAXLOOPS = 100;
                
                while (--$MAXLOOPS>=0) {
@@ -87,15 +87,15 @@ class ADODB_odbc extends ADOConnection {
                        if (empty($this->_connectionID)) $e = @odbc_error(); 
                        else $e = @odbc_error($this->_connectionID);
                        
-                        /*  bug in 4.0.6, error number can be corrupted string (should be 6 digits) */
-                        /*  so we check and patch */
+                        // bug in 4.0.6, error number can be corrupted string (should be 6 digits)
+                        // so we check and patch
                        if (strlen($e)<=2) return 0;
                        return $e;
                } else return ADOConnection::ErrorNo();
        }
        
        
-       /*  returns true or false */
+       // returns true or false
        function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
        {
        global $php_errormsg;
@@ -104,11 +104,11 @@ class ADODB_odbc extends ADOConnection {
                $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode);
                $this->_errorMsg = $php_errormsg;
 
-               /* if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); */
+               //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
                return $this->_connectionID != false;
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
        {
        global $php_errormsg;
@@ -116,7 +116,7 @@ class ADODB_odbc extends ADOConnection {
                $this->_connectionID = odbc_pconnect($argDSN,$argUsername,$argPassword,$this->curmode);
                $this->_errorMsg = $php_errormsg;
                
-               /* if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); */
+               //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
                return $this->_connectionID != false;
        }
 
@@ -157,7 +157,7 @@ class ADODB_odbc extends ADOConnection {
                
                $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
                
-               /* print_r($rs); */
+               //print_r($rs);
                $arr = $rs->GetArray();
                $rs->Close();
                $arr2 = array();
@@ -196,9 +196,9 @@ class ADODB_odbc extends ADOConnection {
                case 12:
                case 0:
                        return 'C';
-               case -1: /* text */
+               case -1: //text
                        return 'X';
-               case -4: /* image */
+               case -4: //image
                        return 'B';
                                
                case 91:
@@ -213,9 +213,9 @@ class ADODB_odbc extends ADOConnection {
                case -6:
                        return 'I';
                        
-               case -11: /*  uniqidentifier */
+               case -11: // uniqidentifier
                        return 'R';
-               case -7: /* bit */
+               case -7: //bit
                        return 'L';
                
                default:
@@ -267,17 +267,17 @@ class ADODB_odbc extends ADOConnection {
                                break;
                        $rs->MoveNext();
                }
-               $rs->Close(); /* -- crashes 4.03pl1 -- why? */
+               $rs->Close(); //-- crashes 4.03pl1 -- why?
                
                return $retarr;
        }
        
        function Prepare($sql)
        {
-               if (! $this->_bindInputArray) return $sql; /*  no binding */
+               if (! $this->_bindInputArray) return $sql; // no binding
                $stmt = odbc_prepare($this->_connectionID,$sql);
                if (!$stmt) {
-               /*      print "Prepare Error for ($sql) ".$this->ErrorMsg()."<br>"; */
+               //      print "Prepare Error for ($sql) ".$this->ErrorMsg()."<br>";
                        return $sql;
                }
                return array($sql,$stmt,false);
@@ -334,7 +334,7 @@ class ADODB_odbc extends ADOConnection {
                return $this->Execute("UPDATE $table SET $column=? WHERE $where",array($val)) != false;
        }
        
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                $ret = @odbc_close($this->_connectionID);
@@ -369,10 +369,10 @@ class ADORecordSet_odbc extends ADORecordSet {
        }
 
 
-       /*  returns the field object */
+       // returns the field object
        function &FetchField($fieldOffset = -1) {
                
-               $off=$fieldOffset+1; /*  offsets begin at 1 */
+               $off=$fieldOffset+1; // offsets begin at 1
                
                $o= new ADOFieldObject();
                $o->name = @odbc_field_name($this->_queryID,$off);
@@ -412,7 +412,7 @@ class ADORecordSet_odbc extends ADORecordSet {
                return false;
        }
        
-       /*  speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated */
+       // speed up SelectLimit() by switching to ADODB_FETCH_NUM as ADODB_FETCH_ASSOC is emulated
        function GetArrayLimit($nrows,$offset=-1) 
        {
                if ($offset <= 0) return $this->GetArray($nrows);
index 0fb61a1876f6ba58183008906eac2e7105efff8e..6bc0adffbb1591b9bb27f72874821e8e0bfcfb25 100644 (file)
@@ -22,7 +22,7 @@ class  ADODB_odbc_mssql extends ADODB_odbc {
        var $fmtDate = "'Y-m-d'";
        var $fmtTimeStamp = "'Y-m-d h:i:sA'";
        var $_bindInputArray = true;
-       var $hasTop = 'top';            /*  support mssql/interbase SELECT TOP 10 * FROM TABLE */
+       var $hasTop = 'top';            // support mssql/interbase SELECT TOP 10 * FROM TABLE
        var $sysDate = 'GetDate()';
        var $sysTimeStamp = 'GetDate()';
        
index b3a0685c4a6bb9a3be08cb2dbbc988defe8a86ec..329c2b9f38fe21dc887aaad990e2934b214a2759 100644 (file)
@@ -18,7 +18,7 @@ if (!defined('_ADODB_ODBC_LAYER')) {
  
 class  ADODB_odbc_oracle extends ADODB_odbc {  
        var $databaseType = 'odbc_oracle';
-       var $replaceQuote = "''"; /*  string to use to replace quotes */
+       var $replaceQuote = "''"; // string to use to replace quotes
     var $concat_operator='||';
        var $fmtDate = "'Y-m-d 00:00:00'"; 
        var $fmtTimeStamp = "'Y-m-d h:i:sA'";
@@ -27,7 +27,7 @@ class  ADODB_odbc_oracle extends ADODB_odbc {
        var $sysDate = "TO_DATE(TO_CHAR(SYSDATE,'YYYY-MM-DD'),'YYYY-MM-DD')";
        var $sysTimeStamp = 'SYSDATE';
        
-       /* var $_bindInputArray = false; */
+       //var $_bindInputArray = false;
        
        function ADODB_odbc_oracle()
        {
@@ -58,7 +58,7 @@ class  ADODB_odbc_oracle extends ADODB_odbc {
                        if ($rs === false) return false;
 
                        $retarr = array();
-                       while (!$rs->EOF) { /* print_r($rs->fields); */
+                       while (!$rs->EOF) { //print_r($rs->fields);
                                $fld = new ADOFieldObject();
                                $fld->name = $rs->fields[0];
                                $fld->type = $rs->fields[1];
@@ -73,7 +73,7 @@ class  ADODB_odbc_oracle extends ADODB_odbc {
                return false;
        }
 
-       /*  returns true or false */
+       // returns true or false
        function _connect($argDSN, $argUsername, $argPassword, $argDatabasename)
        {
        global $php_errormsg;
@@ -83,10 +83,10 @@ class  ADODB_odbc_oracle extends ADODB_odbc {
                $this->_errorMsg = $php_errormsg;
                
                $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
-               /* if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); */
+               //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
                return $this->_connectionID != false;
        }
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename)
        {
        global $php_errormsg;
@@ -95,7 +95,7 @@ class  ADODB_odbc_oracle extends ADODB_odbc {
                $this->_errorMsg = $php_errormsg;
                
                $this->Execute("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
-               /* if ($this->_connectionID) odbc_autocommit($this->_connectionID,true); */
+               //if ($this->_connectionID) odbc_autocommit($this->_connectionID,true);
                return $this->_connectionID != false;
        }
 } 
index f541c286290d589f97146b1443c3380f2953f201..cfcbd4e8e516dd1fedfaccb7f34fe23c645a6bc2 100644 (file)
@@ -13,14 +13,14 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
   
 */
 
-/*  select table_name from cat -- MetaTables */
-/*   */
+// select table_name from cat -- MetaTables
+/
 class ADODB_oracle extends ADOConnection {
     var $databaseType = "oracle";
-    var $replaceQuote = "\'"; /*  string to use to replace quotes */
+    var $replaceQuote = "\'"; // string to use to replace quotes
     var $concat_operator='||';
        var $_curs;
-       var $_initdate = true; /*  init date to YYYY-MM-DD */
+       var $_initdate = true; // init date to YYYY-MM-DD
        var $metaTablesSQL = 'select table_name from cat';      
        var $metaColumnsSQL = "select cname,coltype,width from col where tname='%s' order by colno";
        var $sysDate = "TO_DATE(TO_CHAR(SYSDATE,'YYYY-MM-DD'),'YYYY-MM-DD')";
@@ -30,14 +30,14 @@ class ADODB_oracle extends ADOConnection {
        {
        }
 
-       /*  format and return date string in database date format */
+       // format and return date string in database date format
        function DBDate($d)
        {
                if (is_string($d)) $d = ADORecordSet::UnixDate($d);
                return 'TO_DATE('.date($this->fmtDate,$d).",'YYYY-MM-DD')";
        }
        
-       /*  format and return date string in database timestamp format */
+       // format and return date string in database timestamp format
        function DBTimeStamp($ts)
        {
                if (is_string($ts)) $d = ADORecordSet::UnixTimeStamp($ts);
@@ -81,12 +81,12 @@ class ADODB_oracle extends ADOConnection {
     }
        
 
-        /*  returns true or false */
+        // returns true or false
         function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
         {
                        if ($argHostname) putenv("ORACLE_HOME=$argHostname");
                        if ($argDatabasename) $argUsername .= "@$argDatabasename";
-               /* if ($argHostname) print "<p>Connect: 1st argument should be left blank for $this->databaseType</p>"; */
+               //if ($argHostname) print "<p>Connect: 1st argument should be left blank for $this->databaseType</p>";
             $this->_connectionID = ora_logon($argUsername,$argPassword);
             if ($this->_connectionID === false) return false;
             if ($this->autoCommit) ora_commiton($this->_connectionID);
@@ -94,12 +94,12 @@ class ADODB_oracle extends ADOConnection {
 
             return true;
         }
-        /*  returns true or false */
+        // returns true or false
         function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
         {
                        if ($argHostname) putenv("ORACLE_HOME=$argHostname");
                        if ($argDatabasename) $argUsername .= "@$argDatabasename";
-               /* if ($argHostname) print "<p>PConnect: 1st argument should be left blank for $this->databaseType</p>"; */
+               //if ($argHostname) print "<p>PConnect: 1st argument should be left blank for $this->databaseType</p>";
             $this->_connectionID = ora_plogon($argUsername,$argPassword);
             if ($this->_connectionID === false) return false;
             if ($this->autoCommit) ora_commiton($this->_connectionID);
@@ -108,7 +108,7 @@ class ADODB_oracle extends ADOConnection {
             return true;
         }
 
-        /*  returns query ID if successful, otherwise false */
+        // returns query ID if successful, otherwise false
         function _query($sql,$inputarr)
         {
                  $curs = ora_open($this->_connectionID);
@@ -122,7 +122,7 @@ class ADODB_oracle extends ADOConnection {
                  return false;
         }
 
-        /*  returns true or false */
+        // returns true or false
         function _close()
         {
                if (!$this->autoCommit) ora_rollback($this->_connectionID);
@@ -207,7 +207,7 @@ class ADORecordset_oracle extends ADORecordSet {
    }
 
    function _fetch($ignore_fields=false) {
-/*  should remove call by reference, but ora_fetch_into requires it in 4.0.3pl1 */
+// should remove call by reference, but ora_fetch_into requires it in 4.0.3pl1
                if ($this->fetchMode & ADODB_FETCH_ASSOC)
                        return @ora_fetch_into($this->_queryID,&$this->fields,ORA_FETCHINTO_NULLS|ORA_FETCHINTO_ASSOC);
                else 
@@ -242,7 +242,7 @@ class ADORecordset_oracle extends ADORecordSet {
                
                case 'DATE': return 'D';
                
-               /* case 'T': return 'T'; */
+               //case 'T': return 'T';
                
                case 'BIT': return 'L';
                case 'INT': 
index 956fad521fab62fe433ff865744f2c4ec0a61f37..a5eb150447c9eb8f55968889d02093c217654eab 100644 (file)
@@ -15,15 +15,15 @@ include_once(ADODB_DIR."/drivers/adodb-postgres64.inc.php");
 
 class ADODB_postgres extends ADODB_postgres64 {
        var $databaseType = 'postgres'; 
-       var $hasLimit = true;   /*  set to true for pgsql 6.5+ only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10 */
+       var $hasLimit = true;   // set to true for pgsql 6.5+ only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
 
        function ADODB_postgres() 
        {
                
        }
 
-       /*  the following should be compat with postgresql 7.2,  */
-       /*  which makes obsolete the LIMIT limit,offset syntax */
+       // the following should be compat with postgresql 7.2, 
+       // which makes obsolete the LIMIT limit,offset syntax
         function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) 
         {
          $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
@@ -34,7 +34,7 @@ class ADODB_postgres extends ADODB_postgres64 {
           $this->Execute($sql."$limitStr$offsetStr",$inputarr,$arg3);
         }
  
-       /*  10% speedup to move MoveNext to child class */
+       // 10% speedup to move MoveNext to child class
        function MoveNext() 
        {
                if (!$this->EOF) {              
index 5c7aaf307e662de375e9df66c6745b83964737bd..e796621bd2fb530ae892a2ac88548fd44db10e16 100644 (file)
@@ -25,7 +25,7 @@ class ADODB_postgres64 extends ADOConnection{
     var $_resultid = false;
        var $concat_operator='||';
        var $metaTablesSQL = "select tablename from pg_tables where tablename not like 'pg_%' order by 1";
-       var $isoDates = true; /*  accepts dates in ISO format */
+       var $isoDates = true; // accepts dates in ISO format
        var $sysDate = "CURRENT_DATE";
        var $sysTimeStamp = "CURRENT_TIMESTAMP";
        
@@ -39,38 +39,38 @@ UNION
 SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg_%' ORDER BY 1"
 */
        var $metaColumnsSQL = "SELECT a.attname,t.typname,a.attlen,a.atttypmod,a.attnotnull,a.atthasdef,a.attnum  FROM pg_class c, pg_attribute a,pg_type t WHERE relkind = 'r' AND c.relname='%s' AND a.attnum > 0 AND a.atttypid = t.oid AND a.attrelid = c.oid ORDER BY a.attnum";
-       /*  get primary key etc -- from Freek Dijkstra */
+       // get primary key etc -- from Freek Dijkstra
        var $metaKeySQL = "SELECT ic.relname AS index_name, a.attname AS column_name,i.indisunique AS unique_key, i.indisprimary AS primary_key FROM pg_class bc, pg_class ic, pg_index i, pg_attribute a WHERE bc.oid = i.indrelid AND ic.oid = i.indexrelid AND (i.indkey[0] = a.attnum OR i.indkey[1] = a.attnum OR i.indkey[2] = a.attnum OR i.indkey[3] = a.attnum OR i.indkey[4] = a.attnum OR i.indkey[5] = a.attnum OR i.indkey[6] = a.attnum OR i.indkey[7] = a.attnum) AND a.attrelid = bc.oid AND bc.relname = '%s'";
        
        var $_hastrans = false;
        var $hasAffectedRows = true;
-       var $hasLimit = false;  /*  set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10 */
-       /*  below suggested by Freek Dijkstra  */
-       var $true = 't';                /*  string that represents TRUE for a database */
-       var $false = 'f';               /*  string that represents FALSE for a database */
-       var $fmtDate = "'Y-m-d'";       /*  used by DBDate() as the default date format used by the database */
-       var $fmtTimeStamp = "'Y-m-d G:i:s'"; /*  used by DBTimeStamp as the default timestamp fmt. */
+       var $hasLimit = false;  // set to true for pgsql 7 only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
+       // below suggested by Freek Dijkstra 
+       var $true = 't';                // string that represents TRUE for a database
+       var $false = 'f';               // string that represents FALSE for a database
+       var $fmtDate = "'Y-m-d'";       // used by DBDate() as the default date format used by the database
+       var $fmtTimeStamp = "'Y-m-d G:i:s'"; // used by DBTimeStamp as the default timestamp fmt.
        var $hasMoveFirst = true;
        var $hasGenID = true;
        var $_genIDSQL = "SELECT NEXTVAL('%s')";
        var $_genSeqSQL = "CREATE SEQUENCE %s START %s";
        var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum";
                
-       /*  The last (fmtTimeStamp is not entirely correct:  */
-       /*  PostgreSQL also has support for time zones,  */
-       /*  and writes these time in this format: "2001-03-01 18:59:26+02".  */
-       /*  There is no code for the "+02" time zone information, so I just left that out.  */
-       /*  I'm not familiar enough with both ADODB as well as Postgres  */
-       /*  to know what the concequences are. The other values are correct (wheren't in 0.94) */
-       /*  -- Freek Dijkstra  */
+       // The last (fmtTimeStamp is not entirely correct: 
+       // PostgreSQL also has support for time zones, 
+       // and writes these time in this format: "2001-03-01 18:59:26+02". 
+       // There is no code for the "+02" time zone information, so I just left that out. 
+       // I'm not familiar enough with both ADODB as well as Postgres 
+       // to know what the concequences are. The other values are correct (wheren't in 0.94)
+       // -- Freek Dijkstra 
 
        function ADODB_postgres64() 
        {
-       /*  changes the metaColumnsSQL, adds columns: attnum[6] */
+       // changes the metaColumnsSQL, adds columns: attnum[6]
                        
        }
        
-       /*  get the last id - never tested */
+       // get the last id - never tested
        function pg_insert_id($tablename,$fieldname)
        {
                $result=pg_exec($this->_connectionID, "SELECT last_value FROM ${tablename}_${fieldname}_seq");
@@ -91,15 +91,15 @@ a different OID if a database must be reloaded. */
            return pg_getlastoid($this->_resultid);
     }
 
-/*  I get this error with PHP before 4.0.6 - jlim */
-/*  Warning: This compilation does not support pg_cmdtuples() in d:/inetpub/wwwroot/php/adodb/adodb-postgres.inc.php on line 44 */
+// I get this error with PHP before 4.0.6 - jlim
+// Warning: This compilation does not support pg_cmdtuples() in d:/inetpub/wwwroot/php/adodb/adodb-postgres.inc.php on line 44
    function _affectedrows()
    {
        return pg_cmdtuples($this->_resultid);      
    }
 
        
-               /*  returns true/false */
+               // returns true/false
        function BeginTrans()
        {
                $this->_hastrans = true;
@@ -112,7 +112,7 @@ a different OID if a database must be reloaded. */
                return $this->GetOne("select 1 as ignore from $tables where $where for update");
        }
 
-       /*  returns true/false.  */
+       // returns true/false. 
        function CommitTrans($ok=true) 
        { 
                if (!$ok) return $this->RollbackTrans();
@@ -120,7 +120,7 @@ a different OID if a database must be reloaded. */
                return @pg_Exec($this->_connectionID, "commit");
        }
        
-       /*  returns true/false */
+       // returns true/false
        function RollbackTrans()
        {
                $this->_hastrans = false;
@@ -160,13 +160,13 @@ a different OID if a database must be reloaded. */
        } 
 
 
-       /*  converts table names to lowercase  */
+       // converts table names to lowercase 
     function &MetaColumns($table) 
        {
        global $ADODB_FETCH_MODE;
        
                if (!empty($this->metaColumnsSQL)) {
-                       /*  the following is the only difference -- we lowercase it */
+                       // the following is the only difference -- we lowercase it
                        $save = $ADODB_FETCH_MODE;
                        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
                        
@@ -177,15 +177,15 @@ a different OID if a database must be reloaded. */
                        if ($rs === false) return false;
                        
                        if (!empty($this->metaKeySQL)) {
-                               /*  If we want the primary keys, we have to issue a separate query */
-                               /*  Of course, a modified version of the metaColumnsSQL query using a  */
-                               /*  LEFT JOIN would have been much more elegant, but postgres does  */
-                               /*  not support OUTER JOINS. So here is the clumsy way. */
+                               // If we want the primary keys, we have to issue a separate query
+                               // Of course, a modified version of the metaColumnsSQL query using a 
+                               // LEFT JOIN would have been much more elegant, but postgres does 
+                               // not support OUTER JOINS. So here is the clumsy way.
                                
                                $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
                                
                                $rskey = $this->Execute(sprintf($this->metaKeySQL,strtolower($table)));
-                               /*  fetch all result in once for performance. */
+                               // fetch all result in once for performance.
                                $keys = $rskey->GetArray();
                                
                                $ADODB_FETCH_MODE = $save;
@@ -217,7 +217,7 @@ a different OID if a database must be reloaded. */
                        }
 
                        $retarr = array();
-                       while (!$rs->EOF) { /* print_r($rs->fields); */
+                       while (!$rs->EOF) { //print_r($rs->fields);
                                $fld = new ADOFieldObject();
                                $fld->name = $rs->fields[0];
                                $fld->type = $rs->fields[1];
@@ -225,26 +225,26 @@ a different OID if a database must be reloaded. */
                                if ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;
                                if ($fld->max_length <= 0) $fld->max_length = -1;
                                
-                               /*  dannym */
-                               /*  5 hasdefault; 6 num-of-column */
+                               // dannym
+                               // 5 hasdefault; 6 num-of-column
                                $fld->has_default = ($rs->fields[5] == 't');
                                if ($fld->has_default) {
                                        $fld->default_value = $rsdefa[$rs->fields[6]];
                                }
 
-                               /* Freek */
+                               //Freek
                                if ($rs->fields[4] == $this->true) {
                                        $fld->not_null = true;
                                }
                                
-                               /*  Freek */
+                               // Freek
                                if (is_array($keys)) {
                                        reset ($keys);
                                        while (list($x,$key) = each($keys)) {
                                                if ($fld->name == $key['column_name'] AND $key['primary_key'] == $this->true) 
                                                        $fld->primary_key = true;
                                                if ($fld->name == $key['column_name'] AND $key['unique_key'] == $this->true) 
-                                                       $fld->unique = true; /*  What name is more compatible? */
+                                                       $fld->unique = true; // What name is more compatible?
                                        }
                                }
                                
@@ -273,11 +273,11 @@ a different OID if a database must be reloaded. */
         }
 
 
-       /*  returns true or false */
-       /*  */
-       /*  examples: */
-       /*      $db->Connect("host=host1 user=user1 password=secret port=4341"); */
-       /*      $db->Connect('host1','user1','secret'); */
+       // returns true or false
+       //
+       // examples:
+       //      $db->Connect("host=host1 user=user1 password=secret port=4341");
+       //      $db->Connect('host1','user1','secret');
        function _connect($str,$user='',$pwd='',$db='')
        {           
                if ($user || $pwd || $db) {
@@ -292,18 +292,18 @@ a different OID if a database must be reloaded. */
                        if ($db)   $str .= " dbname=".$db;
                }
                
-               /* if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432"; */
+               //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432";
                $this->_connectionID = pg_connect($str);
                if ($this->_connectionID === false) return false;
                $this->Execute("set datestyle='ISO'");
                 return true;
        }
        
-       /*  returns true or false */
-       /*  */
-       /*  examples: */
-       /*      $db->PConnect("host=host1 user=user1 password=secret port=4341"); */
-       /*      $db->PConnect('host1','user1','secret'); */
+       // returns true or false
+       //
+       // examples:
+       //      $db->PConnect("host=host1 user=user1 password=secret port=4341");
+       //      $db->PConnect('host1','user1','secret');
        function _pconnect($str,$user='',$pwd='',$db='')
        {
                if ($user || $pwd || $db) {
@@ -316,14 +316,14 @@ a different OID if a database must be reloaded. */
                        if ($user) $str .= " user=".$user;
                        if ($pwd)  $str .= " password=".$pwd;
                        if ($db)   $str .= " dbname=".$db;
-               }/* print $str; */
+               }//print $str;
                $this->_connectionID = pg_pconnect($str);
                if ($this->_connectionID === false) return false;
                $this->Execute("set datestyle='ISO'");
                return true;
        }
 
-       /*  returns queryID or false */
+       // returns queryID or false
        function _query($sql,$inputarr)
        {
                 $this->_resultid= pg_Exec($this->_connectionID,$sql);
@@ -339,7 +339,7 @@ a different OID if a database must be reloaded. */
            return $this->_errorMsg;
        }
 
-       /*  returns true or false */
+       // returns true or false
        function _close()
        {
                if ($this->_hastrans) $this->RollbackTrans();
@@ -377,7 +377,7 @@ a different OID if a database must be reloaded. */
        */
        function CharMax()
        {
-               return 1000000000;  /*  should be 1 Gb? */
+               return 1000000000;  // should be 1 Gb?
        }
        
        /*
@@ -385,7 +385,7 @@ a different OID if a database must be reloaded. */
        */
        function TextMax()
        {
-               return 1000000000; /*  should be 1 Gb? */
+               return 1000000000; // should be 1 Gb?
        }
        
                
@@ -445,14 +445,14 @@ class ADORecordSet_postgres64 extends ADORecordSet{
 
        function &FetchField($fieldOffset = 0) 
        {
-               $off=$fieldOffset; /*  offsets begin at 0 */
+               $off=$fieldOffset; // offsets begin at 0
                
                $o= new ADOFieldObject();
                $o->name = @pg_fieldname($this->_queryID,$off);
                $o->type = @pg_fieldtype($this->_queryID,$off);
                $o->max_length = @pg_fieldsize($this->_queryID,$off);
-               /* print_r($o);          */
-               /* print "off=$off name=$o->name type=$o->type len=$o->max_length<br>"; */
+               //print_r($o);          
+               //print "off=$off name=$o->name type=$o->type len=$o->max_length<br>";
                return $o;      
        }
 
@@ -461,7 +461,7 @@ class ADORecordSet_postgres64 extends ADORecordSet{
                return @pg_fetch_row($this->_queryID,$row);
        }
        
-       /*  10% speedup to move MoveNext to child class */
+       // 10% speedup to move MoveNext to child class
        function MoveNext() 
        {
                if (!$this->EOF) {              
@@ -495,9 +495,9 @@ class ADORecordSet_postgres64 extends ADORecordSet{
                    case 'TEXT':
                        return 'X';
                
-                       case 'IMAGE': /*  user defined type */
-                       case 'BLOB': /*  user defined type */
-                   case 'BIT': /*  This is a bit string, not a single bit, so don't return 'L' */
+                       case 'IMAGE': // user defined type
+                       case 'BLOB': // user defined type
+                   case 'BIT': // This is a bit string, not a single bit, so don't return 'L'
                    case 'VARBIT':
                        case 'BYTEA':
                        return 'B';
index 25d57cd764725d90cbc4e4ad82264c479a15f980..eced3fdb6e49f973137fcf6e442d623ee85ddc84 100644 (file)
@@ -15,15 +15,15 @@ include_once(ADODB_DIR."/drivers/adodb-postgres64.inc.php");
 
 class ADODB_postgres7 extends ADODB_postgres64 {
        var $databaseType = 'postgres7';        
-       var $hasLimit = true;   /*  set to true for pgsql 6.5+ only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10 */
+       var $hasLimit = true;   // set to true for pgsql 6.5+ only. support pgsql/mysql SELECT * FROM TABLE LIMIT 10
 
        function ADODB_postgres7() 
        {
                
        }
 
-       /*  the following should be compat with postgresql 7.2,  */
-       /*  which makes obsolete the LIMIT limit,offset syntax */
+       // the following should be compat with postgresql 7.2, 
+       // which makes obsolete the LIMIT limit,offset syntax
         function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) 
         {
          $offsetStr = ($offset >= 0) ? " OFFSET $offset" : '';
@@ -34,7 +34,7 @@ class ADODB_postgres7 extends ADODB_postgres64 {
           $this->Execute($sql."$limitStr$offsetStr",$inputarr,$arg3);
         }
  
-       /*  10% speedup to move MoveNext to child class */
+       // 10% speedup to move MoveNext to child class
        function MoveNext() 
        {
                if (!$this->EOF) {              
index 62636e39eca94e39315e7124ce5f3db1aa4f358f..ffa1be25166a3d3ca16d2c3a087c6bf398a14064 100644 (file)
@@ -25,6 +25,6 @@ if (! defined("_ADODB_PROXY_LAYER")) {
                        $this->ADORecordset($id);
                }
        };
-} /*  define */
+} // define
        
 ?>
\ No newline at end of file
index 19ecee511239868f78b07e41f3afa0f62b071898..36654c13c6ead2d42d4d17ee6eeedcea8634a40b 100644 (file)
@@ -147,7 +147,7 @@ if (!defined('ADODB_SYBASE_SQLANYWHERE')){
    $this->drop_blobvar($blobVarName);
    return true;
   }
- }; /* class */
+ }; //class
 
  class  ADORecordSet_sqlanywhere extends ADORecordSet_odbc {   
 
@@ -159,8 +159,8 @@ if (!defined('ADODB_SYBASE_SQLANYWHERE')){
  }
 
 
- }; /* class */
+ }; //class
 
 
-} /* define */
+} //define
 ?>
index 024ee1da8235fca1309f98bdcc753486cbc24eba..7ed6fce4d3a9d0eab733cc516c91f1832efd7209 100644 (file)
@@ -17,7 +17,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim. All rights reserved.
  
 class ADODB_sybase extends ADOConnection {
        var $databaseType = "sybase";   
-       var $replaceQuote = "''"; /*  string to use to replace quotes */
+       var $replaceQuote = "''"; // string to use to replace quotes
        var $fmtDate = "'Y-m-d'";
        var $fmtTimeStamp = "'Y-m-d H:i:s'";
        var $hasInsertID = true;
@@ -33,12 +33,12 @@ class ADODB_sybase extends ADOConnection {
        {                       
        }
  
-    /*  might require begintrans -- committrans */
+    // might require begintrans -- committrans
     function _insertid()
     {
        return $this->GetOne('select @@identity');
     }
-      /*  might require begintrans -- committrans */
+      // might require begintrans -- committrans
     function _affectedrows()
     {
        return $this->GetOne('select @@rowcount');
@@ -64,7 +64,7 @@ class ADODB_sybase extends ADOConnection {
         return true;
        }
        
-       /*  http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4 */
+       // http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4
        function RowLock($tables,$where) 
        {
                if (!$this->_hastrans) $this->BeginTrans();
@@ -89,7 +89,7 @@ class ADODB_sybase extends ADOConnection {
                return $this->_errorMsg;
        }
 
-       /*  returns true or false */
+       // returns true or false
        function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $this->_connectionID = sybase_connect($argHostname,$argUsername,$argPassword);
@@ -97,7 +97,7 @@ class ADODB_sybase extends ADOConnection {
                if ($argDatabasename) return $this->SelectDB($argDatabasename);
                return true;    
        }
-       /*  returns true or false */
+       // returns true or false
        function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
        {
                $this->_connectionID = sybase_pconnect($argHostname,$argUsername,$argPassword);
@@ -106,14 +106,14 @@ class ADODB_sybase extends ADOConnection {
                return true;    
        }
        
-       /*  returns query ID if successful, otherwise false */
+       // returns query ID if successful, otherwise false
        function _query($sql,$inputarr)
        {
-               /* @sybase_free_result($this->_queryID); */
+               //@sybase_free_result($this->_queryID);
                return sybase_query($sql,$this->_connectionID);
        }
        
-       /*  See http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12 */
+       // See http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12
        function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) 
        {
                $cnt = ($nrows > 0) ? $nrows : 0;
@@ -126,7 +126,7 @@ class ADODB_sybase extends ADOConnection {
                return $rs;
        }
 
-       /*  returns true or false */
+       // returns true or false
        function _close()
        { 
                return @sybase_close($this->_connectionID);
@@ -155,7 +155,7 @@ class ADORecordset_sybase extends ADORecordSet {
 
        var $databaseType = "sybase";
        var $canSeek = true;
-       /*  _mths works only in non-localised system */
+       // _mths works only in non-localised system
        var  $_mths = array('JAN'=>1,'FEB'=>2,'MAR'=>3,'APR'=>4,'MAY'=>5,'JUN'=>6,'JUL'=>7,'AUG'=>8,'SEP'=>9,'OCT'=>10,'NOV'=>11,'DEC'=>12);    
 
        function ADORecordset_sybase($id)
@@ -179,7 +179,7 @@ class ADORecordset_sybase extends ADORecordSet {
                else if ($fieldOffset == -1) {  /*      The $fieldOffset argument is not provided thus its -1   */
                        $o = @sybase_fetch_field($this->_queryID);
                }
-               /*  older versions of PHP did not support type, only numeric */
+               // older versions of PHP did not support type, only numeric
                if ($o && !isset($o->type)) $o->type = ($o->numeric) ? 'float' : 'varchar';
                return $o;
        }
@@ -209,7 +209,7 @@ class ADORecordset_sybase extends ADORecordSet {
                return @sybase_free_result($this->_queryID);            
        }
        
-       /*  sybase/mssql uses a default date like Dec 30 2000 12:00AM */
+       // sybase/mssql uses a default date like Dec 30 2000 12:00AM
        function UnixDate($v)
        {
                return ADORecordSet_array_sybase::UnixDate($v);
@@ -227,12 +227,12 @@ class ADORecordSet_array_sybase extends ADORecordSet_array {
                $this->ADORecordSet_array($id);
        }
        
-               /*  sybase/mssql uses a default date like Dec 30 2000 12:00AM */
+               // sybase/mssql uses a default date like Dec 30 2000 12:00AM
        function UnixDate($v)
        {
        global $ADODB_sybase_mths;
        
-               /* Dec 30 2000 12:00AM */
+               //Dec 30 2000 12:00AM
                if (!ereg( "([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})"
                        ,$v, $rr)) return parent::UnixDate($v);
                        
@@ -241,15 +241,15 @@ class ADORecordSet_array_sybase extends ADORecordSet_array {
                $themth = substr(strtoupper($rr[1]),0,3);
                $themth = $ADODB_sybase_mths[$themth];
                if ($themth <= 0) return false;
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return  mktime(0,0,0,$themth,$rr[2],$rr[3]);
        }
        
        function UnixTimeStamp($v)
        {
        global $ADODB_sybase_mths;
-               /* 11.02.2001 Toni Tunkkari toni.tunkkari@finebyte.com */
-               /* Changed [0-9] to [0-9 ] in day conversion */
+               //11.02.2001 Toni Tunkkari toni.tunkkari@finebyte.com
+               //Changed [0-9] to [0-9 ] in day conversion
                if (!ereg( "([A-Za-z]{3})[-/\. ]([0-9 ]{1,2})[-/\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})"
                        ,$v, $rr)) return parent::UnixTimeStamp($v);
                if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
@@ -268,7 +268,7 @@ class ADORecordSet_array_sybase extends ADORecordSet_array {
                default:
                        break;
                }
-               /*  h-m-s-MM-DD-YY */
+               // h-m-s-MM-DD-YY
                return  mktime($rr[4],$rr[5],0,$themth,$rr[2],$rr[3]);
        }
 }
index f9a1bc035a9bd4a53c8de6964c936787406085e4..7cdb15192e40d932513d5467e525d59eeb295bd7 100644 (file)
@@ -23,9 +23,9 @@ class ADODB_vfp extends ADODB_odbc {
        var $replaceQuote = "'+chr(39)+'" ;
        var $true = '.T.';
        var $false = '.F.';
-       var $hasTop = 'top';            /*  support mssql SELECT TOP 10 * FROM TABLE */
+       var $hasTop = 'top';            // support mssql SELECT TOP 10 * FROM TABLE
        var $upperCase = 'upper';
-       var $_bindInputArray = false; /*  strangely enough, setting to true does not work reliably */
+       var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
        var $sysTimeStamp = 'datetime()';
        var $sysDate = 'date()';
        
@@ -36,7 +36,7 @@ class ADODB_vfp extends ADODB_odbc {
        
        function BeginTrans() { return false;}
 
-       /*  quote string to be sent back to database */
+       // quote string to be sent back to database
        function qstr($s,$nofixquotes=false)
        {
                if (!$nofixquotes) return  "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'";
@@ -44,7 +44,7 @@ class ADODB_vfp extends ADODB_odbc {
        }
 
        
-       /*  TOP requires ORDER BY for VFP */
+       // TOP requires ORDER BY for VFP
        function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$arg3=false,$secs2cache=0)
        {
                if (!preg_match('/ORDER[ \t\r\n]+BY/i',$sql)) $sql .= ' ORDER BY 1';
@@ -86,5 +86,5 @@ class  ADORecordSet_vfp extends ADORecordSet_odbc {
        }
 }
 
-} /* define */
+} //define
 ?>
\ No newline at end of file
index 26fb5f7549481adc962344beca7f753a8e848fdc..46aabb13f5cbc64a16956a19dc642ee4de1abc67 100644 (file)
@@ -101,7 +101,7 @@ This means you can use it in proprietary and commercial products.</p>
   will contribute drivers to support other databases.</p>
 <p>PHP4 supports session variables. You can store your session information using 
   ADOdb for true portability and scalability. See ADOdb-session.php for more information.</p>
-<p>Also read <a href="http:/* php.weblogs.com/portable_sql">http://php.weblogs.com/portable_sql</a>  */
+<p>Also read <a href="http://php.weblogs.com/portable_sql">http://php.weblogs.com/portable_sql</a> 
   (also available as tips_portable_sql.htm in the release) for tips on writing 
   portable SQL.</p>
 <h2>Unique Features of ADOdb<a name="features"></a></h2>
@@ -120,25 +120,25 @@ This means you can use it in proprietary and commercial products.</p>
 </ul>
 <h2>How People are using ADOdb<a name="users"></a></h2>
 Here are some examples of how people are using ADOdb (for a much longer list, 
-visit <a href="http:/* php.weblogs.com/adodb-cool-applications">http://php.weblogs.com/ADOdb-cool-applications</a>):  */
+visit <a href="http://php.weblogs.com/adodb-cool-applications">http://php.weblogs.com/ADOdb-cool-applications</a>): 
 <ul>
-<li><a href="http:/* phplens.com/">PhpLens</a> is a commercial data grid component that allows both cool Web designers and serious unshaved programmers to develop and maintain databases on the Web easily. Developed by the author of ADOdb.<p> */
+<li><a href="http://phplens.com/">PhpLens</a> is a commercial data grid component that allows both cool Web designers and serious unshaved programmers to develop and maintain databases on the Web easily. Developed by the author of ADOdb.<p>
 
-<li><a href="http:/* www.interakt.ro/phakt/">PHAkt: PHP Extension for DreamWeaver Ultradev</a> allows you to script PHP in the popular Web page editor. Database handling provided by ADOdb.<p> */
+<li><a href="http://www.interakt.ro/phakt/">PHAkt: PHP Extension for DreamWeaver Ultradev</a> allows you to script PHP in the popular Web page editor. Database handling provided by ADOdb.<p>
 
-<li><a href="http:/* www.andrew.cmu.edu/~rdanyliw/snort/snortacid.html">Analysis Console for Intrusion Databases</a> (ACID): PHP-based analysis engine to search and process a database of security incidents generated by security-related software such as IDSes and firewalls (e.g. Snort, ipchains). By Roman Danyliw.<p> */
+<li><a href="http://www.andrew.cmu.edu/~rdanyliw/snort/snortacid.html">Analysis Console for Intrusion Databases</a> (ACID): PHP-based analysis engine to search and process a database of security incidents generated by security-related software such as IDSes and firewalls (e.g. Snort, ipchains). By Roman Danyliw.<p>
 
-<li><a href="http:/* www.postnuke.com/">PostNuke</a> is a very popular free content management */
+<li><a href="http://www.postnuke.com/">PostNuke</a> is a very popular free content management
  system and weblog system. It offers full CSS support, HTML 4.01 transitional compliance throughout, an advanced blocks system, and is fully multi-lingual enabled. <p>
 
-<li><a href=http:/* www.auto-net.no/easypublish.php?page=index&lang_id=2>EasyPublish CMS</a>  is another free content management system for managing information and integrated modules on your internet, intranet- and extranet-sites. From Norway.<p> */
+<li><a href=http://www.auto-net.no/easypublish.php?page=index&lang_id=2>EasyPublish CMS</a>  is another free content management system for managing information and integrated modules on your internet, intranet- and extranet-sites. From Norway.<p>
 
-<li><a href="http:/* nola.noguska.com/">NOLA</a> is a full featured accounting, inventory, and job tracking application. It is licensed under the GPL, and developed by Noguska. */
+<li><a href="http://nola.noguska.com/">NOLA</a> is a full featured accounting, inventory, and job tracking application. It is licensed under the GPL, and developed by Noguska.
 </ul><p>
 
 <h2>Feature Requests and Bug Reports<a name="bugs"></a></h2>
 <p>Feature requests and bug reports can be emailed to <a href="mailto:jlim#natsoft.com.my">jlim#natsoft.com.my</a> 
-  or posted to the ADOdb Help forums at <a href="http:/* phplens.com/lens/lensforum/topics.php?id=4">http://phplens.com/lens/lensforum/topics.php?id=4</a>.</p> */
+  or posted to the ADOdb Help forums at <a href="http://phplens.com/lens/lensforum/topics.php?id=4">http://phplens.com/lens/lensforum/topics.php?id=4</a>.</p>
 <h2>Installation Guide<a name="install"></a></h2>
 <p>Make sure you are running PHP4.01pl2 or later (it uses require_once and include_once). 
   Unpack all the files into a directory accessible by your webserver.</p>
@@ -224,7 +224,7 @@ You will use <code>$conn-><a href=#connect>Connect()</a></code> or
        <td height="54"><font size="2">Y/N</font></td>
        <td height="54"><font size="2">DB2 CLI/ODBC interface</font></td>
        <td height="54"> 
-         <p><font size="2">Unix and Windows. <a href="http:/* www.faqts.com/knowledge_base/view.phtml/aid/6283/fid/14">Unix  */
+         <p><font size="2">Unix and Windows. <a href="http://www.faqts.com/knowledge_base/view.phtml/aid/6283/fid/14">Unix 
                install hints</a>.</font></p>
        </td>
   </tr>
@@ -302,7 +302,7 @@ You will use <code>$conn-><a href=#connect>Connect()</a></code> or
        <td height="73"><font size="2">Y/N</font></td>
        <td height="73"><font size="2">Mssql client</font></td>
        <td height="73"> 
-         <p><font size="2">Unix and Windows. <a href="http:/* phpbuilder.com/columns/alberto20000919.php3"><br> */
+         <p><font size="2">Unix and Windows. <a href="http://phpbuilder.com/columns/alberto20000919.php3"><br>
                Unix install howto</a>.</font></p>
        </td>
   </tr>
@@ -369,7 +369,7 @@ You will use <code>$conn-><a href=#connect>Connect()</a></code> or
          PConnect('DSN','user','pwd').</font></td>
        <td><font size="2">? depends on database</font></td>
        <td><font size="2">ODBC</font></td>
-       <td><font size="2">Unix and Windows. <a href="http:/* phpbuilder.com/columns/alberto20000919.php3?page=4">Unix  */
+       <td><font size="2">Unix and Windows. <a href="http://phpbuilder.com/columns/alberto20000919.php3?page=4">Unix 
          hints.</a></font></td>
   </tr>
   <tr valign="top"> 
@@ -818,9 +818,9 @@ another way of handling errors using ADOdb's custom error handlers.
 <p>
 ADOdb provides two custom handlers which you can modify for your needs.
 The first one is in the <b>ADOdb-errorhandler.inc.php</b> file. This makes
-use of the standard PHP functions <a href=http:/* php.net/error_reporting>error_reporting</a> */
+use of the standard PHP functions <a href=http://php.net/error_reporting>error_reporting</a>
 to control what error messages types to display,
-and <a href=http:/* php.net/trigger_error>trigger_error</a> which invokes the default */
+and <a href=http://php.net/trigger_error>trigger_error</a> which invokes the default
 PHP error handler.
 <p>
 Including the above file  will cause <i>trigger_error($errorstring,E_USER_ERROR)</i>
@@ -850,7 +850,7 @@ if ($rs) $rs2html($rs);
  <p>
  If you want to log the error message, you can do so by defining the following optional
   constants ADODB_ERROR_LOG_TYPE and ADODB_ERROR_LOG_DEST. ADODB_ERROR_LOG_TYPE is 
-  the error log message type (see <a href=http:/* php.net/error_log>error_log</a> */
+  the error log message type (see <a href=http://php.net/error_log>error_log</a>
   in the PHP manual). In this case we set 
   it to 3, which means log to the file defined by the constant ADODB_ERROR_LOG_DEST.
  
@@ -911,7 +911,7 @@ PEAR::setErrorHandling('PEAR_ERROR_DIE');
 <h2><a name="dsn"></a> Data Source Names</h2>
 <p>We now support connecting using PEAR style DSN's. A DSN is a connection string 
   of the form:</p>
-<p>$dsn = <i>&quot;$driver:/* $username:$password@$hostname/$databasename&quot;</i>;</p> */
+<p>$dsn = <i>&quot;$driver://$username:$password@$hostname/$databasename&quot;</i>;</p>
 <p>You pass the DSN to the static class function DB::Connect. An example:</p>
 <pre>   include_once('../adodb/adodb-pear.inc.php');
    $username = 'root';
@@ -919,7 +919,7 @@ PEAR::setErrorHandling('PEAR_ERROR_DIE');
    $hostname = 'localhost';
    $databasename = 'xphplens';
    $driver = 'mysql';
-   $dsn = &quot;$driver:/* $username:$password@$hostname/$databasename&quot;;</pre> */
+   $dsn = &quot;$driver://$username:$password@$hostname/$databasename&quot;;</pre>
 <pre>   $db = DB::Connect($dsn);<br>   $rs = $db-&gt;Execute('select firstname,lastname from adoxyz');
    $cnt = 0;
    while ($arr = $rs-&gt;FetchRow()) {
@@ -1074,7 +1074,7 @@ this.</p>
 <pre> # $oraname in tnsnames.ora/ONAMES/HOSTNAMES
  $conn->Connect(false, 'scott', 'tiger', $oraname); 
  $conn->Connect('server:1521', 'scott', 'tiger', 'ServiceName'); # bypass tnsnames.ora</pre>
-<p>There are many examples of connecting to a database at <a href="http:/* php.weblogs.com/adodb">php.weblogs.com/ADOdb</a>,  */
+<p>There are many examples of connecting to a database at <a href="http://php.weblogs.com/adodb">php.weblogs.com/ADOdb</a>, 
   and in the testdatabases.inc.php file included in the release.</p>
 <p><b>PConnect<a name="PConnect"></a>($host,[$user],[$password],[$database])</b></p>
 <p>Persistent connect to data source or server $<b>host</b>, using userid $<b>user</b> 
@@ -1127,7 +1127,7 @@ $rs = $db->Execute('select name from table where val=:key',
 <p></p>
 <p> Alternatively, since ADOdb 1.80, the $secs2cache parameter is optional:</p>
 <pre>  $conn-&gt;Connect(...);
-       $conn-&gt;cacheSecs = 3600*24; /*  cache 24 hours */
+       $conn-&gt;cacheSecs = 3600*24; // cache 24 hours
        $rs = $conn-&gt;CacheExecute('select * from table');
 </pre>
 <p>If multiple calls to CacheExecute() are made and the recordset is still cached, 
@@ -1192,7 +1192,7 @@ $rs = $db->Execute('select name from table where val=:key',
 <p>Since 1.80, $secs2cache has been optional:</p>
 </font> 
 <pre><font color="#000000">    $conn-&gt;Connect(...);
-       $conn-&gt;cacheSecs = 3600*24; /*  cache 24 hours */
+       $conn-&gt;cacheSecs = 3600*24; // cache 24 hours
        $rs = $conn-&gt;CacheSelectLimit('select * from table',10);</font></pre>
 <font color="#000000"> 
 <p><b>CacheFlush<a name="CacheFlush"></a>($sql)</b></p>
@@ -1200,7 +1200,7 @@ $rs = $db->Execute('select name from table where val=:key',
   If you want to flush all cached recordsets, execute the following PHP code (works 
   only under Unix): <code>system(&quot;rm -f `find &quot;.ADODB_CACHE_DIR.&quot; 
   -name ADODB_*.cache`&quot;);</code></p>
-<p>For general cleanup of all expired files, you should use <a href="http:/* www.superscripts.com/tutorial/crontab.html">crontab</a>  */
+<p>For general cleanup of all expired files, you should use <a href="http://www.superscripts.com/tutorial/crontab.html">crontab</a> 
   on Unix, or at.exe on Windows, and a shell script similar to the following:</p>
 <p><font face="Courier New, Courier, mono">#------------------------------------------------------ 
   <br>
@@ -1421,7 +1421,7 @@ for ($i=0; $i &lt; $max; $i++)<br></font> $DB-&gt;<font color="#000000">Execute(
   [$<i><b>isOutput</b></i>] Indicates direction of parameter 0/false=IN 1=OUT 
   2= IN/OUT. This is ignored in oci8 as this driver auto-detects the direction.<br>
   [$<b>maxLen</b>] Maximum length of the parameter variable.<br>
-  [$<b>type</b>] Consult <a href="http:/* php.net/mssql_bind">mssql_bind</a> and <a href="http://php.net/ocibindbyname">ocibindbyname</a>  */
+  [$<b>type</b>] Consult <a href="http://php.net/mssql_bind">mssql_bind</a> and <a href="http://php.net/ocibindbyname">ocibindbyname</a> 
   docs at php.net for more info on legal values for type.</p>
 <p>In mssql, $opt can hold the following elements: array('type' =&gt; integer, 
   maxLen =&gt;integer). Example:</p>
@@ -1901,12 +1901,12 @@ $<font color="#663300">rs</font>   = $<font color="#663300">conn</font>->Execute
 <p><b>ADOConnection Fields to Set</b></p>
 <p>canSeek: Set to true if the _seek function works.</p>
 <h2>ToDo:</h2>
-<p>See the <a href=http:/* php.weblogs.com/adodb-todo-roadmap>RoadMap</a> article.</p> */
-<p>Also see the ADOdb <a href=http:/* php.weblogs.com/adodb_csv>proxy</a> article  */
+<p>See the <a href=http://php.weblogs.com/adodb-todo-roadmap>RoadMap</a> article.</p>
+<p>Also see the ADOdb <a href=http://php.weblogs.com/adodb_csv>proxy</a> article 
   for bridging Windows and Unix databases using http remote procedure calls. For
-  your education, visit <a href=http:/* palslib.com/>palslib.com</a> for database info, */
+  your education, visit <a href=http://palslib.com/>palslib.com</a> for database info,
   and read this article 
-  on <a href=http:/* phplens.com/lens/php-book/optimizing-debugging-php.php>Optimizing PHP</a>. */
+  on <a href=http://phplens.com/lens/php-book/optimizing-debugging-php.php>Optimizing PHP</a>.
 </p>
 </font>
 <h2>Change Log<a name="Changes"></a><a name=ChangeLog></a></h2>
@@ -2023,7 +2023,7 @@ CacheSelectLimit(), the secs2cache is still compulsory - sigh.
   when supporting new ADODB_FETCH_MODEs.
  <p>Mattia Rossi (mattia#technologist.com) contributed BlobDecode() and UpdateBlobFile() for postgresql
  using the postgres specific pg_lo_import()/pg_lo_open() - i don't use them but hopefully others will
- find this useful. See <a href="http:/* phplens.com/lens/lensforum/msgs.php?id=1262">this posting</a> */
+ find this useful. See <a href="http://phplens.com/lens/lensforum/msgs.php?id=1262">this posting</a>
  for an example of usage.
  <p>Added UpdateBlobFile() for uploading files to a database.
  <p>Made UpdateBlob() compatible with oci8po driver.
@@ -2181,7 +2181,7 @@ in MetaType() improved. MetaColumns() returns columns in correct sort order.</p>
 <p>Cached recordset timestamp not saved in some scenarios. Fixed.</p>
 <p><b>1.10 19 May 2001</b></p>
 <p>Added caching. CacheExecute() and CacheSelectLimit().
-<p>Added csv driver. See <a href="http:/* php.weblogs.com/adodb_csv">http://php.weblogs.com/ADODB_csv</a>.  */
+<p>Added csv driver. See <a href="http://php.weblogs.com/adodb_csv">http://php.weblogs.com/ADODB_csv</a>. 
 <p>Fixed SelectLimit(), SELECT TOP not working under certain circumstances.
 <p>Added better Frontbase support of MetaTypes() by Frank M. Kromann.
 <p><b>1.01 24 April 2001</b></p>
index b2697d1787bbcb396ee44ec8c5cf73446dee8152..202ae5b3e943fbaeef8b859edb4cfabba3938a69 100644 (file)
@@ -31,13 +31,13 @@ $ACCEPTIP = '';
  * Connection parameters
  */
 $driver = 'mysql';
-$host = 'localhost'; /*  DSN for odbc */
+$host = 'localhost'; // DSN for odbc
 $uid = 'root';
 $pwd = '';
 $database = 'northwind';
 
 /*============================ DO NOT MODIFY BELOW HERE =================================*/
-/*  $sep must match csv2rs() in adodb.inc.php */
+// $sep must match csv2rs() in adodb.inc.php
 $sep = ' :::: ';
 
 include('./adodb.inc.php');
@@ -48,11 +48,11 @@ function err($s)
        die('**** '.$s.' ');
 }
 
-/*  undo stupid magic quotes */
+// undo stupid magic quotes
 function undomq(&$m) 
 {
        if (get_magic_quotes_gpc()) {
-               /*  undo the damage */
+               // undo the damage
                $m = str_replace('\\\\','\\',$m);
                $m = str_replace('\"','"',$m);
                $m = str_replace('\\\'','\'',$m);
@@ -61,7 +61,7 @@ function undomq(&$m)
        return $m;
 }
 
-/* /////////////////////////////////////// DEFINITIONS */
+///////////////////////////////////////// DEFINITIONS
 
 
 $remote = $HTTP_SERVER_VARS["REMOTE_ADDR"]; 
@@ -87,7 +87,7 @@ if (isset($HTTP_GET_VARS['nrows'])) {
 } else 
        $rs = $conn->Execute($sql);
 if ($rs){ 
-       /* $rs->timeToLive = 1; */
+       //$rs->timeToLive = 1;
        echo _rs2serialize($rs,$conn,$sql);
        $rs->Close();
 } else
index e9e2eee9acac817fe1a5764051e89fa8ade2d3f5..0a3d1691b02d3fa8a12ca7476a5bdbed7478237a 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-/* W3C//DTD HTML 4.0 Transitional//EN"> */
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
 <html>
 <head>
@@ -18,15 +18,15 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
   It should not be used as proof of the superiority of one database over the other.
 */ 
  
-/* $testmssql = true; */
-/* $testvfp = true; */
+//$testmssql = true;
+//$testvfp = true;
 $testoracle = true;
-/* $testado = true;  */
-/* $testibase = true; */
+//$testado = true; 
+//$testibase = true;
 $testaccess = true;
 $testmysql = true;
 
-set_time_limit(240); /*  increase timeout */
+set_time_limit(240); // increase timeout
 
 include("../tohtml.inc.php");
 include("../adodb.inc.php");
@@ -42,20 +42,20 @@ GLOBAL $ADODB_version,$ADODB_FETCH_MODE;
        
        print "<h3>ADODB Version: $ADODB_version Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i></h3>";
        
-       /*  perform query once to cache results so we are only testing throughput  */
+       // perform query once to cache results so we are only testing throughput 
        $rs = $db->Execute($sql);
        if (!$rs){
                print "Error in recordset<p>";
                return;
        }       
        $arr = $rs->GetArray();
-       /* $db->debug = true; */
+       //$db->debug = true;
 
        $start = microtime();
        for ($i=0; $i < $max; $i++) {
                $rs = $db->Execute($sql);       
                $arr = $rs->GetArray();
-       /*          print $arr[0][1]; */
+       //         print $arr[0][1];
        }
        $end =  microtime();
        $start = explode(' ',$start);
@@ -64,7 +64,7 @@ GLOBAL $ADODB_version,$ADODB_FETCH_MODE;
        print_r($start);
        print_r($end);
        
-      /*   print_r($arr); */
+      //  print_r($arr);
        $total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
        printf ("<p>seconds = %8.2f for %d iterations each with %d records</p>",$total,$max, sizeof($arr));
        flush();
@@ -74,7 +74,7 @@ GLOBAL $ADODB_version,$ADODB_FETCH_MODE;
        <table width=100% ><tr><td bgcolor=beige>&nbsp;</td></tr></table>
        </p>
 <?php
-        /* $db->Close(); */
+        //$db->Close();
 }
 include("testdatabases.inc.php");
 
index af9757be9e913cd9d14d5cf8005968cd43fc42d6..eb5e8c92c9e0ea09fa15c18ec31d382920c4e43e 100644 (file)
@@ -10,7 +10,7 @@
  * set tabs to 8
  */
  
- /*  documentation on usage is at http://php.weblogs.com/adodb_csv */
+ // documentation on usage is at http://php.weblogs.com/adodb_csv
  
 include('../adodb.inc.php');
 include('../tohtml.inc.php');
@@ -30,7 +30,7 @@ include('../tohtml.inc.php');
  }
 
 
-$serverURL = 'http:/* localhost/php/phplens/adodb/server.php'; */
+$serverURL = 'http://localhost/php/phplens/adodb/server.php';
 $testhttp = false;
 
 $sql1 = "insertz into products (productname) values ('testprod 1')";
index faa951de300b13c4a600331d6b1320192827d462..bdd14080f6443bfafe3efb1b4c3ab85edcfeb2e5 100644 (file)
@@ -26,7 +26,7 @@ if (sizeof($HTTP_GET_VARS) == 0) $testmysql = true;
 
 This script tests the following databases: Interbase, Oracle, Visual FoxPro, Microsoft Access (ODBC and ADO), MySQL, MSSQL (ODBC, native, ADO). 
 There is also support for Sybase, PostgreSQL.</p>
-For the latest version of ADODB, visit <a href=http:/* php.weblogs.com/ADODB>php.weblogs.com</a>.</p> */
+For the latest version of ADODB, visit <a href=http://php.weblogs.com/ADODB>php.weblogs.com</a>.</p>
 
 <form method=get>
 <input type=checkbox name=testaccess value=1 <?php echo !empty($testaccess) ? 'checked' : '' ?>> Access<br>
@@ -46,7 +46,7 @@ Test <a href=test4.php>GetInsertSQL/GetUpdateSQL</a> &nbsp;
 <?php
 
 
-/*  Set the following control flags to true/false to enable testing for a particular database. */
+// Set the following control flags to true/false to enable testing for a particular database.
 /*
 $testoracle = true;
 $testibase = true;
@@ -60,15 +60,15 @@ $testmysql = true;
 
 error_reporting(E_ALL);
 
-set_time_limit(240); /*  increase timeout */
+set_time_limit(240); // increase timeout
 
 include("../tohtml.inc.php");
 include("../adodb.inc.php");
 
 if ($ADODB_FETCH_MODE != ADODB_FETCH_DEFAULT) print "<h3>FETCH MODE IS NOT ADODB_FETCH_DEFAULT</h3>";
 
-/*  the table creation code is specific to the database, so we allow the user  */
-/*  to define their own table creation stuff */
+// the table creation code is specific to the database, so we allow the user 
+// to define their own table creation stuff
 function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
 {
 GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE, $HTTP_GET_VARS,$ADODB_COUNTRECS;
@@ -94,7 +94,7 @@ GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE, $HTTP_GET_VARS,$ADODB_COU
        print "<br><i>ts3</i> (1970-1-2 +/- timezone) = ".$db->DBTimeStamp(24*3600);
         $dd = $db->UnixDate('1999-02-20');
        print "<br>unixdate</i> 1999-02-20 = ".date('Y-m-d',$dd)."<p>";
-       /*  mssql too slow in failing bad connection */
+       // mssql too slow in failing bad connection
        if ($db->databaseType != 'mssql') {
                print "<p>Testing bad connection. Ignore following error msgs:<br>";
                $db2 = ADONewConnection();
@@ -105,16 +105,16 @@ GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE, $HTTP_GET_VARS,$ADODB_COU
        }
        error_reporting($e);
        
-       /* $ADODB_COUNTRECS=false; */
+       //$ADODB_COUNTRECS=false;
        $rs=$db->Execute('select * from adoxyz order by id');
-       /* print_r($rs); */
-       /* OCIFetchStatement($rs->_queryID,$rez,0,-1);//,OCI_ASSOC | OCI_FETCHSTATEMENT_BY_ROW); */
-       /* print_r($rez); */
-       /* die(); */
+       //print_r($rs);
+       //OCIFetchStatement($rs->_queryID,$rez,0,-1);//,OCI_ASSOC | OCI_FETCHSTATEMENT_BY_ROW);
+       //print_r($rez);
+       //die();
        if($rs === false) $create = true;
        else $rs->Close();
        
-       /* if ($db->databaseType !='vfp') $db->Execute("drop table ADOXYZ"); */
+       //if ($db->databaseType !='vfp') $db->Execute("drop table ADOXYZ");
         
        if ($create) {
            if ($db->databaseType == 'ibase') {
@@ -128,7 +128,7 @@ GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE, $HTTP_GET_VARS,$ADODB_COU
                }
     }
        
-       $rs = &$db->Execute("delete from ADOXYZ"); /*  some ODBC drivers will fail the drop so we delete */
+       $rs = &$db->Execute("delete from ADOXYZ"); // some ODBC drivers will fail the drop so we delete
        if ($rs) {
                if(! $rs->EOF)print "<b>Error: </b>RecordSet returned by Execute('delete...') should show EOF</p>";
                $rs->Close();
@@ -140,7 +140,7 @@ GLOBAL $ADODB_vers,$ADODB_CACHE_DIR,$ADODB_FETCH_MODE, $HTTP_GET_VARS,$ADODB_COU
        if ($rs) $rs->Close();
        
        
-       /* $db->debug=true;      */
+       //$db->debug=true;      
        print "<p>Testing Commit: ";
        $time = $db->DBDate(time());
        if (!$db->BeginTrans()) print '<b>Transactions not supported</b></p>';
@@ -311,7 +311,7 @@ GO
        $db->debug = false;
 
        $ADODB_FETCH_MODE = ADODB_FETCH_BOTH;
- /* //////////////////////////////////////////////////////////////////////////////////////// */
+ //////////////////////////////////////////////////////////////////////////////////////////
        
        $rs = &$db->Execute("select id,firstname as TheFirstName,lastname,created from ADOXYZ order by id");
        if ($rs) {
@@ -342,7 +342,7 @@ GO
        $rs = &$db->Execute('select * from ADOXYZ');
        if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
        
-       while ($o = $rs->FetchNextObject()) { /*  calls FetchObject internally */
+       while ($o = $rs->FetchNextObject()) { // calls FetchObject internally
                if (!is_string($o->FIRSTNAME) || !is_string($o->LASTNAME)) {
                        print_r($o);
                        print "<p><b>Firstname is not string</b></p>";
@@ -355,7 +355,7 @@ GO
        $rs = &$db->Execute('select * from ADOXYZ');
        if (empty($rs->connection)) print "<b>Connection object missing from recordset</b></br>";
        
-       while ($o = $rs->FetchNextObject()) { /*  calls FetchObject internally */
+       while ($o = $rs->FetchNextObject()) { // calls FetchObject internally
                if (!is_string($o->FIRSTNAME) || !is_string($o->LASTNAME)) {
                        print_r($o);
                        print "<p><b>Firstname is not string</b></p>";
@@ -420,7 +420,7 @@ GO
                if (trim($arr['firstname']) != 'Caroline') {print "<b>Error 2</b><br>"; print_r($arr);};
 
        }
-       /* $db->debug = true; */
+       //$db->debug = true;
        print "<p>SelectLimit Test 1: Should see Caroline, John and Mary</p>";
        $rs = &$db->SelectLimit('select distinct * from ADOXYZ order by id',3);
        if ($rs && !$rs->EOF) {
@@ -431,7 +431,7 @@ GO
                if (trim($rs->fields[1]) != 'Mary') print "<b>Error 3</b><br>";
                $rs->MoveNext();
                if (! $rs->EOF) print "<b>Not EOF</b><br>";
-               /* rs2html($rs); */
+               //rs2html($rs);
        }
        else "<p><b>Failed SelectLimit Test 1</b></p>";
        print "<p>SelectLimit Test 2: Should see Mary, George and Mr. Alan</p>";
@@ -444,7 +444,7 @@ GO
                if (trim($rs->fields[1]) != 'Mr. Alan') print "<b>Error 3</b><br>";
                $rs->MoveNext();
                if (! $rs->EOF) print "<b>Not EOF</b><br>";
-       /*      rs2html($rs); */
+       //      rs2html($rs);
        }
        else "<p><b>Failed SelectLimit Test 2</b></p>";
        
@@ -457,7 +457,7 @@ GO
                if (trim($rs->fields[1]) != 'Steven') print "<b>Error 2</b><br>";
                $rs->MoveNext();
                if (! $rs->EOF) print "<b>Not EOF</b><br>";
-               /* rs2html($rs); */
+               //rs2html($rs);
        }
        else "<p><b>Failed SelectLimit Test 3</b></p>";
                $db->debug = false;
@@ -476,7 +476,7 @@ GO
                        }
                        else print "MoveFirst() OK<BR>";
                         
-                        /*  Move(3) tests error handling -- MoveFirst should not move cursor */
+                        // Move(3) tests error handling -- MoveFirst should not move cursor
                        $rs->Move(3);
                        if (trim($rs->Fields("firstname")) != 'George') {
                                print '<p>'.$rs->Fields("id")."<b>$db->databaseType: Move(3) failed</b></p>";
@@ -497,7 +497,7 @@ GO
                }
        }
        
- /*    $db->debug=true; */
+ //    $db->debug=true;
        print "<p>Testing ADODB_FETCH_ASSOC and concat: concat firstname and lastname</p>";
        
        $save = $ADODB_FETCH_MODE;
@@ -589,7 +589,7 @@ GO
        if ($val == 0) echo " <p><b>GenID not supported</b>";
        echo "<p>";
        
-       if (substr($db->dataProvider,0,3) != 'notused') { /*  used to crash ado */
+       if (substr($db->dataProvider,0,3) != 'notused') { // used to crash ado
                $sql = "select firstnames from adoxyz";
                print "<p>Testing execution of illegal statement: <i>$sql</i></p>";
                if ($db->Execute($sql) === false) {
@@ -665,7 +665,7 @@ GO
        } else {
                print "<p><b>\$db->sysDate not defined</b></p>";
        }
-       /*  PEAR TESTS BELOW */
+       // PEAR TESTS BELOW
        $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
        $pear = true;
        $rs = $db->query('select * from adoxyz order by id');
@@ -674,7 +674,7 @@ GO
        if ($rs && !$rs->EOF) {
                while ($arr = $rs->fetchRow()) {
                        $i++;
-                       /* print "$i "; */
+                       //print "$i ";
                        if ($arr[0] != $i) {
                                print "<p><b>PEAR DB emulation error 1.</b></p>";
                                $pear = false;
@@ -716,7 +716,7 @@ GO
        if ($ret != 1) print "<b>Replace failed: </b>";
        print "test B return value=$ret (1 expected) <p>";
        
-       /* /////////////////////////////////////////////////////////// */
+       /////////////////////////////////////////////////////////////
 
 
        
@@ -733,8 +733,8 @@ GO
                while (!is_object($rs->fetchInto($arr))) {
                        $i2++;
                        
-       /*                      print_r($arr); */
-       /*              print "$i ";print_r($arr); */
+       //                      print_r($arr);
+       //              print "$i ";print_r($arr);
                        if ($arr[0] != $i2) {
                                print "<p><b>PEAR DB emulation error 2.</b></p>";
                                $pear = false;
index 3f4d3480ba290447c8d859bc0f884d512da0d598..8056bf5d3ffd272aedc37c59b8be9c0fb85d6970 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-/* W3C//DTD HTML 4.0 Transitional//EN"> */
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
 <html>
 <head>
index 7e8799c92a05e29308ebd5325ef87a9a47badf5c..66cb9d6b4df9585cba91aa9cc4333407639ac502 100644 (file)
@@ -20,54 +20,54 @@ function testsql()
 include('../adodb.inc.php');
 include('../tohtml.inc.php');
 
-/* ========================== */
-/*  This code tests an insert */
+//==========================
+// This code tests an insert
 
 $sql = "SELECT * FROM ADOXYZ WHERE id = -1"; 
-/*  Select an empty record from the database  */
+// Select an empty record from the database 
 
-$conn = &ADONewConnection("mysql");  /*  create a connection */
+$conn = &ADONewConnection("mysql");  // create a connection
 $conn->debug=1;
-$conn->PConnect("localhost", "root", "", "test"); /*  connect to MySQL, testdb */
+$conn->PConnect("localhost", "root", "", "test"); // connect to MySQL, testdb
 $conn->Execute("delete from adoxyz where lastname like 'Smith%'");
 
-$rs = $conn->Execute($sql); /*  Execute the query and get the empty recordset */
-$record = array(); /*  Initialize an array to hold the record data to insert */
+$rs = $conn->Execute($sql); // Execute the query and get the empty recordset
+$record = array(); // Initialize an array to hold the record data to insert
 
-/*  Set the values for the fields in the record */
+// Set the values for the fields in the record
 $record["firstname"] = "Bob";
-$record["lastname"] = "Smith\$@/* "; */
+$record["lastname"] = "Smith\$@//";
 $record["created"] = time();
 
-/*  Pass the empty recordset and the array containing the data to insert */
-/*  into the GetInsertSQL function. The function will process the data and return */
-/*  a fully formatted insert sql statement. */
+// Pass the empty recordset and the array containing the data to insert
+// into the GetInsertSQL function. The function will process the data and return
+// a fully formatted insert sql statement.
 $insertSQL = $conn->GetInsertSQL($rs, $record);
 
-$conn->Execute($insertSQL); /*  Insert the record into the database */
+$conn->Execute($insertSQL); // Insert the record into the database
 
-/* ========================== */
-/*  This code tests an update */
+//==========================
+// This code tests an update
 
 $sql = "SELECT * FROM ADOXYZ WHERE lastname=".$conn->qstr($record['lastname']); 
-/*  Select a record to update  */
+// Select a record to update 
 
-$rs = $conn->Execute($sql); /*  Execute the query and get the existing record to update */
+$rs = $conn->Execute($sql); // Execute the query and get the existing record to update
 if (!$rs) print "<p>No record found!</p>";
-$record = array(); /*  Initialize an array to hold the record data to update */
+$record = array(); // Initialize an array to hold the record data to update
 
-/*  Set the values for the fields in the record */
+// Set the values for the fields in the record
 $record["firstname"] = "Caroline".rand();
-$record["lastname"] = "Smithy"; /*  Update Caroline's lastname from Miranda to Smith */
+$record["lastname"] = "Smithy"; // Update Caroline's lastname from Miranda to Smith
 $record["created"] = '2002-12-'.(rand()%30+1);
 
-/*  Pass the single record recordset and the array containing the data to update */
-/*  into the GetUpdateSQL function. The function will process the data and return */
-/*  a fully formatted update sql statement. */
-/*  If the data has not changed, no recordset is returned */
+// Pass the single record recordset and the array containing the data to update
+// into the GetUpdateSQL function. The function will process the data and return
+// a fully formatted update sql statement.
+// If the data has not changed, no recordset is returned
 $updateSQL = $conn->GetUpdateSQL($rs, $record);
 
-$conn->Execute($updateSQL); /*  Update the record in the database */
+$conn->Execute($updateSQL); // Update the record in the database
 print "<p>Rows Affected=".$conn->Affected_Rows()."</p>";
 
 rs2html($conn->Execute("select * from adoxyz where lastname like 'Smith%'"));
index 5d89e70c516f7a7bb25c963d68aa9e6fe256b019..b4c1f3291fe514689b072e1ddb9408ca4d220ea2 100644 (file)
@@ -10,7 +10,7 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
 */
 
 
-/*  Select an empty record from the database  */
+// Select an empty record from the database 
 
 include('../adodb.inc.php');
 include('../tohtml.inc.php');
@@ -23,16 +23,16 @@ if (0) {
 }
 
 if (0) {
-       $conn = &ADONewConnection("oci8");  /*  create a connection */
+       $conn = &ADONewConnection("oci8");  // create a connection
        $conn->debug=1;
-       $conn->PConnect("falcon", "scott", "tiger", "juris8.ecosystem.natsoft.com.my"); /*  connect to MySQL, testdb */
+       $conn->PConnect("falcon", "scott", "tiger", "juris8.ecosystem.natsoft.com.my"); // connect to MySQL, testdb
        print $conn->databaseType.':'.$conn->GenID();
 }
 
 if (0) {
-       $conn = &ADONewConnection("ibase");  /*  create a connection */
+       $conn = &ADONewConnection("ibase");  // create a connection
        $conn->debug=1;
-       $conn->Connect("localhost:c:\\Interbase\\Examples\\Database\\employee.gdb", "sysdba", "masterkey", ""); /*  connect to MySQL, testdb */
+       $conn->Connect("localhost:c:\\Interbase\\Examples\\Database\\employee.gdb", "sysdba", "masterkey", ""); // connect to MySQL, testdb
        print $conn->databaseType.':'.$conn->GenID().'<br>';
 }
 
index dcccbabe4280231b60e2370c341dd18e43d47c75..2e0745ecf342c753c28c9966a919a1d954e3e12d 100644 (file)
@@ -9,8 +9,8 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
  
  /* this file is used by the ADODB test program: test.php */
  
-/*  cannot test databases below, but we include them anyway to check */
-/*  if they parse ok... */
+// cannot test databases below, but we include them anyway to check
+// if they parse ok...
 ADOLoadCode("sybase");
 ADOLoadCode("postgres");
 ADOLoadCode("postgres7");
@@ -20,7 +20,7 @@ ADOLoadCode("informix");
 ADOLoadCode("sqlanywhere");
 
 if (!empty($testpostgres)) {
-       /* ADOLoadCode("postgres"); */
+       //ADOLoadCode("postgres");
        $db = &ADONewConnection('postgres64');
        print "<h1>Connecting $db->databaseType...</h1>";
        if (@$db->PConnect("susetikus","tester","test","test")) {
@@ -38,7 +38,7 @@ if (!empty($testibase)) {
        
 }
 
-/*  REQUIRES ODBC DSN CALLED nwind */
+// REQUIRES ODBC DSN CALLED nwind
 if (!empty($testaccess)) {
 
        $db = &ADONewConnection('access');
@@ -50,7 +50,7 @@ if (!empty($testaccess)) {
        
 }
 
-if (!empty($testaccess) && !empty($testado)) { /*  ADO ACCESS */
+if (!empty($testaccess) && !empty($testado)) { // ADO ACCESS
        
        $db = &ADONewConnection("ado_access");
        print "<h1>Connecting $db->databaseType...</h1>";
@@ -58,7 +58,7 @@ if (!empty($testaccess) && !empty($testado)) { /*  ADO ACCESS */
        $access = 'd:\inetpub\wwwroot\php\NWIND.MDB';
        $myDSN =  'PROVIDER=Microsoft.Jet.OLEDB.4.0;'
                . 'DATA SOURCE=' . $access . ';';
-               /* . 'USER ID=;PASSWORD=;'; */
+               //. 'USER ID=;PASSWORD=;';
        
        if (@$db->PConnect($myDSN, "", "", "")) {
                print "ADO version=".$db->_connectionID->version."<br>";
@@ -67,7 +67,7 @@ if (!empty($testaccess) && !empty($testado)) { /*  ADO ACCESS */
        
 }
 
-if (!empty($testvfp)) { /*  ODBC */
+if (!empty($testvfp)) { // ODBC
 
        
        $db = &ADONewConnection('vfp');
@@ -79,8 +79,8 @@ if (!empty($testvfp)) { /*  ODBC */
 }
 
 
-/*  REQUIRES MySQL server at localhost with database 'test' */
-if (!empty($testmysql)) { /*  MYSQL */
+// REQUIRES MySQL server at localhost with database 'test'
+if (!empty($testmysql)) { // MYSQL
        
        $db = &ADONewConnection('maxsql');
        print "<h1>Connecting $db->databaseType...</h1>";
@@ -95,7 +95,7 @@ if (!empty($testmysql)) { /*  MYSQL */
        print "<h1>Connecting $db->databaseType...</h1>";
        if ($HTTP_SERVER_VARS['HTTP_HOST'] == 'localhost') $server = 'localhost';
 
-       if ($db->PConnect('http:/* localhost/php/phplens/adodb/server.php')) */
+       if ($db->PConnect('http://localhost/php/phplens/adodb/server.php'))
                testdb($db,
                "create table ADOXYZ (id int, firstname char(24), lastname char(24), created date) type=innodb");
        else print "ERROR: MySQL test requires a MySQL server on localhost, userid='admin', password='', database='test'".'<BR>'.$db->ErrorMsg();
@@ -109,12 +109,12 @@ if (!empty($testoracle)) {
        $db = ADONewConnection('oci8po');
        print "<h1>Connecting $db->databaseType...</h1>";
        if ($db->Connect('', "scott", "tiger",'natsoft.ecosystem.natsoft.com.my'))
-       /* if ($db->PConnect("", "scott", "tiger", "juris.ecosystem.natsoft.com.my")) */
+       //if ($db->PConnect("", "scott", "tiger", "juris.ecosystem.natsoft.com.my"))
                testdb($db,"create table ADOXYZ (id int, firstname varchar(24), lastname varchar(24),created date)");
        else print "ERROR: Oracle test requires an Oracle server setup with scott/tiger".'<BR>'.$db->ErrorMsg();
 
 }
-ADOLoadCode("oracle"); /*  no longer supported */
+ADOLoadCode("oracle"); // no longer supported
 if (false && !empty($testoracle)) { 
        
        $db = ADONewConnection();
@@ -127,7 +127,7 @@ if (false && !empty($testoracle)) {
 
 
 ADOLoadCode("odbc_mssql");
-if (!empty($testmssql) && false) { /*  MS SQL Server via ODBC */
+if (!empty($testmssql) && false) { // MS SQL Server via ODBC
        
        $db = ADONewConnection();
        
@@ -140,7 +140,7 @@ if (!empty($testmssql) && false) { /*  MS SQL Server via ODBC */
 
 ADOLoadCode("ado_mssql");
 
-if (!empty($testmssql) && !empty($testado) ) { /*  ADO ACCESS MSSQL -- thru ODBC -- DSN-less */
+if (!empty($testmssql) && !empty($testado) ) { // ADO ACCESS MSSQL -- thru ODBC -- DSN-less
        
        $db = &ADONewConnection("ado_mssql");
        $db->debug=1;
@@ -158,7 +158,7 @@ if (!empty($testmssql) && !empty($testado) ) { /*  ADO ACCESS MSSQL -- thru ODBC
 
 
 ADOLoadCode("mssql");
-if (!empty($testmssql)) { /*  MS SQL Server -- the extension is buggy -- probably better to use ODBC */
+if (!empty($testmssql)) { // MS SQL Server -- the extension is buggy -- probably better to use ODBC
        $db = ADONewConnection();
        $db->debug=1;
        print "<h1>Connecting $db->databaseType...</h1>";
@@ -172,13 +172,13 @@ if (!empty($testmssql)) { /*  MS SQL Server -- the extension is buggy -- probabl
        
 }
 
-if (!empty($testmssql) && !empty($testado)) { /*  ADO ACCESS MSSQL with OLEDB provider */
+if (!empty($testmssql) && !empty($testado)) { // ADO ACCESS MSSQL with OLEDB provider
 
        $db = &ADONewConnection("ado_mssql");
        print "<h1>Connecting DSN-less OLEDB Provider $db->databaseType...</h1>";
        $db->debug=1;
        $myDSN="SERVER=mangrove;DATABASE=ai;";
-       /* $myDSN='SERVER=(local)\NetSDK;DATABASE=northwind;'; */
+       //$myDSN='SERVER=(local)\NetSDK;DATABASE=northwind;';
        if ($db->PConnect($myDSN, "sa", "natsoft", 'SQLOLEDB'))
                testdb($db,"create table ADOXYZ (id int, firstname char(24), lastname char(24),created datetime)");
        else print "ERROR: MSSQL test 2 requires a MS SQL 7 on a server='mangrove', userid='sa', password='', database='ai'";
index 2906bcf8ab02047a12316ccd5890a22289e15b7e..5112e4b0c7f9bf4d79c5de1554a3548afecddaa0 100644 (file)
@@ -14,7 +14,7 @@ function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24)
        $table = 'adodbseq';
        
        $db->Execute("drop table $table");
-       /* $db->debug=true; */
+       //$db->debug=true;
        
        $ctr = 5000;
        $lastnum = 0;
index 547211391f5a7f5d4e22968be8057e013454f78a..10050a085aef6f9ffe10f764e2c2de1bc9d228e8 100644 (file)
@@ -19,18 +19,18 @@ error_reporting(E_ALL);
 include('../adodb.inc.php');
 include('../tohtml.inc.php');
 
-/* ========================== */
-/*  This code tests an insert */
+//==========================
+// This code tests an insert
 
 
 
-$conn = &ADONewConnection("odbc_mssql");  /*  create a connection */
+$conn = &ADONewConnection("odbc_mssql");  // create a connection
 $conn->Connect('sqlserver','sa','natsoft');
 
-/* $conn = &ADONewConnection("mssql"); */
-/* $conn->Connect('mangrove','sa','natsoft','ai'); */
+//$conn = &ADONewConnection("mssql");
+//$conn->Connect('mangrove','sa','natsoft','ai');
 
-/* $conn->Connect('mangrove','sa','natsoft','ai'); */
+//$conn->Connect('mangrove','sa','natsoft','ai');
 $conn->debug=1;
 $conn->Execute('delete from blobtest');
 
@@ -44,7 +44,7 @@ $fd = fopen($output, "wb");
 fwrite($fd, $rs->fields[0]); 
 fclose($fd); 
 
-print " <a href=file:/* $output>View Image</a>"; */
-/* $rs = $conn->Execute('SELECT id,SUBSTRING(b1, 1, 10) FROM blobtest'); */
-/* rs2html($rs); */
+print " <a href=file://$output>View Image</a>";
+//$rs = $conn->Execute('SELECT id,SUBSTRING(b1, 1, 10) FROM blobtest');
+//rs2html($rs);
 ?>
\ No newline at end of file
index 7e547291000b234e6bcbc45f4e98bf6b6a189438..f6519161b2528e16b947f09b2a494fa796fe5b9e 100644 (file)
@@ -22,7 +22,7 @@ if (1) {
        if (!empty($testblob)) {
                $varHoldingBlob = 'ABC DEF GEF John TEST';
                $num = time()%10240;
-               /*  create table atable (id integer, ablob blob); */
+               // create table atable (id integer, ablob blob);
                $db->Execute('insert into ATABLE (id,ablob) values('.$num.',empty_blob())');
                $db->UpdateBlob('ATABLE', 'ablob', $varHoldingBlob, 'id='.$num, 'BLOB');
                
@@ -51,8 +51,8 @@ if (1) {
        print $db->Affected_Rows().'<BR>';
        $stmt = &$db->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
        $rs = $db->Execute($stmt,array('empno'=>4321,'ename'=>'John'));
-       /*  prepare not quite ready for prime time */
-       /* $rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John')); */
+       // prepare not quite ready for prime time
+       //$rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John'));
        if (!$rs) die("Empty RS");
 }
 
index 44b144f2033a681f22dc6bb3a028fac12b9bb095..c04d38eb75032816ca7142814109949ee376ec97 100644 (file)
@@ -47,11 +47,11 @@ if (empty($driver) or $driver == 'mysql') {
        $db->Connect('localhost','root','','xphplens');
 }
 
-/* $db->pageExecuteCountRows = false; */
+//$db->pageExecuteCountRows = false;
 
 $db->debug = true;
 
 $pager = new ADODB_Pager($db,$sql);
-/* $pager->cache = 60; */
+//$pager->cache = 60;
 $pager->Render($rows=7);
 ?>
\ No newline at end of file
index d33364c330087acfeedf117d9147387a319cb098..7665f4c3659ce6edd58cd3104cdc3126d524c6c3 100644 (file)
@@ -18,7 +18,7 @@ $hostname = 'localhost';
 $databasename = 'xphplens';
 $driver = 'mysql';
 
-$dsn = "$driver:/* $username:$password@$hostname/$databasename"; */
+$dsn = "$driver://$username:$password@$hostname/$databasename";
 
 $db = DB::Connect($dsn);
 $db->setFetchMode(ADODB_FETCH_ASSOC);
index d3500f874ba87911f53f1b4d7ad09ca918b63be4..d58d3a337ece1b14e49ac63e4645468276f014b7 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-/* W3C//DTD HTML 4.0 Transitional//EN"> */
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
 <html>
 <head>
@@ -15,7 +15,7 @@
   Dimension in my Mac days, to the databases I currently use, which are: Oracle, 
   FoxPro, Access, MS SQL Server and MySQL. Although most of the advice here applies 
   to using SQL with Perl, Python and other programming languages, I will focus on PHP and how 
-  the <a href="http:/* php.weblogs.com/adodb">ADOdb</a> database abstraction library  */
+  the <a href="http://php.weblogs.com/adodb">ADOdb</a> database abstraction library 
   offers some solutions.<p></p>
 <p>Most database vendors practice product lock-in. The best or fastest way to 
   do things is often implemented using proprietary extensions to SQL. This makes 
@@ -257,8 +257,8 @@ $rs = $db-&gt;Execute(sprintf($sqlSearchKeyWord,$db-&gt;qstr($word)));</pre>
 sound principles. Learn the theory of normalization and entity-relationship diagrams and model 
 your data carefully. Understand how joins and indexes work and how they are used to tune performance.
 <p> Visit the following page for more references on database theory and vendors: 
-  <a href="http:/* php.weblogs.com/sql_tutorial">http://php.weblogs.com/sql_tutorial</a>.  */
-  Also read this article on <a href=http:/* phplens.com/lens/php-book/optimizing-debugging-php.php>Optimizing PHP</a>. */
+  <a href="http://php.weblogs.com/sql_tutorial">http://php.weblogs.com/sql_tutorial</a>. 
+  Also read this article on <a href=http://phplens.com/lens/php-book/optimizing-debugging-php.php>Optimizing PHP</a>.
 <p>
 <font size=1>(c) 2002 John Lim.</font>
 
index a11d219ccc1e617df3c9112ab11c986b89265588..e1ff267396ff9bde682ddb248498c772b7b12a35 100644 (file)
  * rscsvout($rs);
  */
  
-/*  returns a recordset as a csv string */
+// returns a recordset as a csv string
 function rs2csv(&$rs,$addtitles=true)
 {
        return _adodb_export($rs,',',',',false,$addtitles);
 }
 
-/*  writes recordset to csv file  */
+// writes recordset to csv file 
 function rs2csvfile(&$rs,$fp,$addtitles=true)
 {
        _adodb_export($rs,',',',',$fp,$addtitles);
 }
 
-/*  write recordset as csv string to stdout */
+// write recordset as csv string to stdout
 function rs2csvout(&$rs,$addtitles=true)
 {
-       $fp = fopen('php:/* stdout','wb'); */
+       $fp = fopen('php://stdout','wb');
        _adodb_export($rs,',',',',true,$addtitles);
        fclose($fp);
 }
@@ -46,16 +46,16 @@ function tab2csv(&$rs,$addtitles=true)
        return _adodb_export($rs,"\t",',',false,$addtitles);
 }
 
-/*  to file pointer */
+// to file pointer
 function tab2csvfile(&$rs,$fp,$addtitles=true)
 {
        _adodb_export($rs,"\t",',',$fp,$addtitles);
 }
 
-/*  to stdout */
+// to stdout
 function tab2csvout(&$rs,$addtitles=true)
 {
-       $fp = fopen('php:/* stdout','wb'); */
+       $fp = fopen('php://stdout','wb');
        _adodb_export($rs,"\t",' ',true,$addtitles);
        fclose($fp);
 }
@@ -63,8 +63,8 @@ function tab2csvout(&$rs,$addtitles=true)
 function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote = '"',$escquote = '"',$replaceNewLine = ' ')
 {
        if (!$rs) return '';
-       /* ---------- */
-       /*  CONSTANTS */
+       //----------
+       // CONSTANTS
        $NEWLINE = "\r\n";
        $BUFLINES = 100;
        $escquotequote = $escquote.$quote;
@@ -100,7 +100,7 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote =
                                if (strpos($v,$sep) || strpos($v,$quote))$elements[] = "$quote$v$quote";
                                else $elements[] = $v;
                        }
-               } else { /*  ASSOCIATIVE ARRAY */
+               } else { // ASSOCIATIVE ARRAY
                        foreach($rs->fields as $v) {
                                if ($escquote) $v = str_replace($quote,$escquotequote,$v);
                                $v = strip_tags(str_replace("\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)));
index bd722fbc1bb02d03f5ad7b93d97da2a9a8b3fe1c..2cbaf44c24a73e4fb7df37270dc76bcc8e63a6a1 100644 (file)
@@ -8,33 +8,33 @@ V2.12 12 June 2002 (c) 2000-2002 John Lim (jlim@natsoft.com.my). All rights rese
   Some pretty-printing by Chris Oxenreider <oxenreid@state.net>
 */ 
   
-/*  specific code for tohtml */
+// specific code for tohtml
 GLOBAL $gSQLMaxRows,$gSQLBlockRows;
         
-$gSQLMaxRows = 1000; /*  max no of rows to download */
-$gSQLBlockRows=20; /*  max no of rows per table block */
+$gSQLMaxRows = 1000; // max no of rows to download
+$gSQLBlockRows=20; // max no of rows per table block
 
-/*  RecordSet to HTML Table */
-/* ------------------------------------------------------------ */
-/*  Convert a recordset to a html table. Multiple tables are generated */
-/*  if the number of rows is > $gSQLBlockRows. This is because */
-/*  web browsers normally require the whole table to be downloaded */
-/*  before it can be rendered, so we break the output into several */
-/*  smaller faster rendering tables. */
-/*  */
-/*  $rs: the recordset */
-/*  $ztabhtml: the table tag attributes (optional) */
-/*  $zheaderarray: contains the replacement strings for the headers (optional) */
-/*  */
-/*   USAGE: */
-/*     include('adodb.inc.php'); */
-/*     $db = ADONewConnection('mysql'); */
-/*     $db->Connect('mysql','userid','password','database'); */
-/*     $rs = $db->Execute('select col1,col2,col3 from table'); */
-/*     rs2html($rs, 'BORDER=2', array('Title1', 'Title2', 'Title3')); */
-/*     $rs->Close(); */
-/*  */
-/*  RETURNS: number of rows displayed */
+// RecordSet to HTML Table
+//------------------------------------------------------------
+// Convert a recordset to a html table. Multiple tables are generated
+// if the number of rows is > $gSQLBlockRows. This is because
+// web browsers normally require the whole table to be downloaded
+// before it can be rendered, so we break the output into several
+// smaller faster rendering tables.
+//
+// $rs: the recordset
+// $ztabhtml: the table tag attributes (optional)
+// $zheaderarray: contains the replacement strings for the headers (optional)
+//
+//  USAGE:
+//    include('adodb.inc.php');
+//    $db = ADONewConnection('mysql');
+//    $db->Connect('mysql','userid','password','database');
+//    $rs = $db->Execute('select col1,col2,col3 from table');
+//    rs2html($rs, 'BORDER=2', array('Title1', 'Title2', 'Title3'));
+//    $rs->Close();
+//
+// RETURNS: number of rows displayed
 function rs2html(&$rs,$ztabhtml='',$zheaderarray="")
 {
 $s ='';$rows=0;$docnt = false;
@@ -46,7 +46,7 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows;
        }
        
        if (! $ztabhtml) $ztabhtml = "BORDER='1' WIDTH='98%'";
-       /* else $docnt = true; */
+       //else $docnt = true;
        $typearr = array();
        $ncols = $rs->FieldCount();
     $hdr = "<TABLE COLS=$ncols $ztabhtml>\n\n";
@@ -55,7 +55,7 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows;
                if ($zheaderarray) $fname = $zheaderarray[$i];
                else $fname = htmlspecialchars($field->name);   
                $typearr[$i] = $rs->MetaType($field->type,$field->max_length);
-               /* print " $field->name $field->type $typearr[$i] "; */
+               //print " $field->name $field->type $typearr[$i] ";
                    
                if (empty($fname)) $fname = '&nbsp;';
                $hdr .= "<TH>$fname</TH>";
@@ -63,7 +63,7 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows;
 
        print $hdr."\n\n";
        
-       /*  smart algorithm - handles ADODB_FETCH_MODE's correctly! */
+       // smart algorithm - handles ADODB_FETCH_MODE's correctly!
        $numoffset = isset($rs->fields[0]);
     while (!$rs->EOF) {
         $s .= "<TR>\n";
@@ -91,25 +91,25 @@ GLOBAL $gSQLMaxRows,$gSQLBlockRows;
                        $s = stripslashes($s);
                        $s = urldecode($s);
                        }
-               } /*  for */
+               } // for
         $s .= "</TR>\n\n";
               
                $rows += 1;
                if ($rows >= $gSQLMaxRows) {
                        $rows = "<p>Truncated at $gSQLMaxRows</p>";
                        break;
-               } /*  switch */
+               } // switch
 
                $rs->MoveNext();
        
-       /*  additional EOF check to prevent a widow header */
+       // additional EOF check to prevent a widow header
         if (!$rs->EOF && $rows % $gSQLBlockRows == 0) {
        
-               /* if (connection_aborted()) break;// not needed as PHP aborts script, unlike ASP */
+               //if (connection_aborted()) break;// not needed as PHP aborts script, unlike ASP
                print $s . "</TABLE>\n\n";
                $s = $hdr;
                }
-    } /*  while */
+    } // while
 
     print $s."</TABLE>\n\n";
 
@@ -123,7 +123,7 @@ function arr2html(&$arr,$ztabhtml='',$zheaderarray='')
 {
        if (!$ztabhtml) $ztabhtml = 'BORDER=1';
        
-       $s = "<TABLE $ztabhtml>";/* ';print_r($arr); */
+       $s = "<TABLE $ztabhtml>";//';print_r($arr);
 
        if ($zheaderarray) {
                $s .= '<TR>';
index b84cc9ee8cb779eaa374c5fb3d3b40d33df66289..4fba780afd96d6a2d77023f105e09f34be4b0de7 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-/* W3C//DTD HTML 4.0 Transitional//EN"> */
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
 <html>
 <head>
@@ -41,7 +41,7 @@
 <p>ADODB stands for Active Data Objects DataBase (sorry computer guys are sometimes 
   not very original). ADODB currently supports MySQL, PostgreSQL, Oracle, Interbase, 
   Microsoft SQL Server, Access, FoxPro, Sybase, ODBC and ADO. You can download 
-  ADODB from <a href=http:/* php.weblogs.com/adodb><a href="http://php.weblogs.com/adodb">http://php.weblogs.com/adodb</a></a>. */
+  ADODB from <a href=http://php.weblogs.com/adodb><a href="http://php.weblogs.com/adodb">http://php.weblogs.com/adodb</a></a>.
 <h3>MySQL Example</h3>
 <p>The most common database used with PHP is MySQL, so I guess you should be familiar 
   with the following code. It connects to a MySQL server at <i>localhost</i>, 
@@ -133,8 +133,8 @@ $db-&gt;<b>Connect</b>(&quot;localhost&quot;, &quot;root&quot;, &quot;password&q
        $rs1 = $db->Execute('select * from table');
        $<b>ADODB_FETCH_MODE</b> = ADODB_FETCH_ASSOC;
        $rs2 = $db->Execute('select * from table');
-       print_r($rs1->fields); /*  shows <i>array([0]=>'v0',[1] =>'v1')</i> */
-       print_r($rs2->fields); /*  shows <i>array(['col1']=>'v0',['col2'] =>'v1')</i> */
+       print_r($rs1->fields); // shows <i>array([0]=>'v0',[1] =>'v1')</i>
+       print_r($rs2->fields); // shows <i>array(['col1']=>'v0',['col2'] =>'v1')</i>
 </pre>
 <p>
 As you can see in the above example, both recordsets store and use different fetch modes
@@ -160,7 +160,7 @@ based on the $ADODB_FETCH_MODE setting when the recordset was created by Execute
    $conn-&gt;PConnect('localhost','userid','password','database');
    $rs = $conn-&gt;Execute('select * from table');
   <b> rs2html($rs)</b>; /* recordset to html table */ </pre>
-<p>There are many other helper functions that are listed in the documentation available at <a href="http:/* php.weblogs.com/adodb_manual"><a href="http://php.weblogs.com/adodb_manual">http://php.weblogs.com/adodb_manual</a></a>.  */
+<p>There are many other helper functions that are listed in the documentation available at <a href="http://php.weblogs.com/adodb_manual"><a href="http://php.weblogs.com/adodb_manual">http://php.weblogs.com/adodb_manual</a></a>. 
 <h2>Advanced Material</h2>
 <h3>Inserts and Updates </h3>
 <p>Let's say you want to insert the following data into a database. 
@@ -228,7 +228,7 @@ $connection->CacheSelectLimit($secs2cache,$sql,$nrows,$offset).
 <p><b>PHP4 Session Handler Support</b> 
 <p>ADODB also supports PHP4 session handlers. You can store your session variables 
   in a database for true scalability using ADODB. For further information, visit 
-  <a href="http:/* php.weblogs.com/adodb-sessions"><a href="http://php.weblogs.com/adodb-sessions">http://php.weblogs.com/adodb-sessions</a></a> */
+  <a href="http://php.weblogs.com/adodb-sessions"><a href="http://php.weblogs.com/adodb-sessions">http://php.weblogs.com/adodb-sessions</a></a>
 <h3>Commercial Use Encouraged</h3>
 <p>If you plan to write commercial PHP applications that you want to resell, you should consider ADODB. It has been released using the lesser GPL, which means you can legally include it in commercial applications, while keeping your code proprietary. Commercial use of ADODB is strongly encouraged! We are using it internally for this reason.<p>