[phplib-dev] cvs commit From: kir (phplib-dev <email protected>)
Date: 07/01/00

From: kir
Date: Sun Jul 2 00:13:53 2000
Modified files:
      php-lib-stable/CHANGES
      php-lib-stable/php/db_msql.inc
      php-lib-stable/php/db_mssql.inc
      php-lib-stable/php/db_oci8.inc
      php-lib-stable/php/db_odbc.inc
      php-lib-stable/php/db_oracle.inc
      php-lib-stable/php/db_pgsql.inc
      php-lib-stable/php/db_sybase.inc

Log message:

  - Fixed bug with empty query in all remaining db_*sql.inc (PHP4 issue)
  - Added constructor with $query to all db_*sql.inc files

Index: php-lib-stable/CHANGES
diff -u php-lib-stable/CHANGES:1.6 php-lib-stable/CHANGES:1.7
--- php-lib-stable/CHANGES:1.6 Sat Jul 1 00:56:45 2000
+++ php-lib-stable/CHANGES Sun Jul 2 00:13:20 2000
@@ -1,4 +1,8 @@
-$Id: CHANGES,v 1.6 2000/06/30 22:56:45 athompso Exp $
+$Id: CHANGES,v 1.7 2000/07/01 22:13:20 kir Exp $
+
+02 Jul 2000 kir
+ - Fixed bug with empty query in all db_*sql.inc (PHP4 issue)
+ - Added constructor with $query to all db_*sql.inc files
 
 30-Jun-2000 athompso
   - Added null-query special case handling to db_pgsql.inc
Index: php-lib-stable/php/db_msql.inc
diff -u php-lib-stable/php/db_msql.inc:1.1 php-lib-stable/php/db_msql.inc:1.2
--- php-lib-stable/php/db_msql.inc:1.1 Mon Apr 17 18:40:08 2000
+++ php-lib-stable/php/db_msql.inc Sun Jul 2 00:13:21 2000
@@ -7,7 +7,7 @@
  *
  * Derived from db_mysql.inc by Sascha Schumann <sascha <email protected>>
  *
- * $Id: db_msql.inc,v 1.1 2000/04/17 16:40:08 kk Exp $
+ * $Id: db_msql.inc,v 1.2 2000/07/01 22:13:21 kir Exp $
  *
  */
 
@@ -24,6 +24,11 @@
   
   var $Auto_Free = 0; ## Set this to 1 for automatic msql_free_result()
 
+ /* public: constructor */
+ function DB_Sql($query = "") {
+ $this->query($query);
+ }
+
   function connect() {
     // Not connected? Then connect?
     if ( 0 == $this->Link_ID ) {
@@ -45,6 +50,15 @@
   }
   
   function query($Query_String) {
+
+ /* No empty queries, please, since PHP4 chokes on them. */
+ if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
+ return 0;
+
     $this->connect();
 
 # printf("Debug: query = %s<br>\n", $Query_String);
Index: php-lib-stable/php/db_mssql.inc
diff -u php-lib-stable/php/db_mssql.inc:1.1 php-lib-stable/php/db_mssql.inc:1.2
--- php-lib-stable/php/db_mssql.inc:1.1 Mon Apr 17 18:40:09 2000
+++ php-lib-stable/php/db_mssql.inc Sun Jul 2 00:13:21 2000
@@ -6,7 +6,7 @@
  * Modified by Guarneri carmelo (carmelo <email protected>)
  * Modified by Cameron Just (C.Just <email protected>)
  *
- * $Id: db_mssql.inc,v 1.1 2000/04/17 16:40:09 kk Exp $
+ * $Id: db_mssql.inc,v 1.2 2000/07/01 22:13:21 kir Exp $
  */
 # echo "<BR>This is using the MSSQL class<BR>";
 
@@ -27,6 +27,11 @@
   var $Auto_Free = 0; ## set this to 1 to automatically free results
   
   
+ /* public: constructor */
+ function DB_Sql($query = "") {
+ $this->query($query);
+ }
+
   function connect() {
     if ( 0 == $this->Link_ID ) {
       $this->Link_ID=mssql_pconnect($this->Host, $this->User, $this->Password);
@@ -41,7 +46,17 @@
           $this->Query_ID = 0;
   }
   
- function query($Query_String) {
+ function query($Query_String)
+ {
+
+ /* No empty queries, please, since PHP4 chokes on them. */
+ if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
+ return 0;
+
           if (!$this->Link_ID)
             $this->connect();
     
Index: php-lib-stable/php/db_oci8.inc
diff -u php-lib-stable/php/db_oci8.inc:1.2 php-lib-stable/php/db_oci8.inc:1.3
--- php-lib-stable/php/db_oci8.inc:1.2 Wed Jun 21 16:44:07 2000
+++ php-lib-stable/php/db_oci8.inc Sun Jul 2 00:13:21 2000
@@ -8,7 +8,7 @@
  * based on db_oracle.inc by Luis Francisco Gonzalez Hernandez
  * contains metadata() from db_oracle.inc 1.10
  *
- * $Id: db_oci8.inc,v 1.2 2000/06/21 14:44:07 baerli Exp $
+ * $Id: db_oci8.inc,v 1.3 2000/07/01 22:13:21 kir Exp $
  *
  */
 
@@ -26,6 +26,11 @@
   var $Parse;
   var $Error = "";
 
+ /* public: constructor */
+ function DB_Sql($query = "") {
+ $this->query($query);
+ }
+
   function connect() {
       if ( 0 == $this->Link_ID ) {
           if($this->Debug) {
@@ -46,6 +51,16 @@
   }
   
   function query($Query_String) {
+
+ /* No empty queries, please, since PHP4 chokes on them. */
+ if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
+ return 0;
+
+
       $this->connect();
 
        $this->Parse=OCIParse($this->Link_ID,$Query_String);
Index: php-lib-stable/php/db_odbc.inc
diff -u php-lib-stable/php/db_odbc.inc:1.1 php-lib-stable/php/db_odbc.inc:1.2
--- php-lib-stable/php/db_odbc.inc:1.1 Mon Apr 17 18:40:09 2000
+++ php-lib-stable/php/db_odbc.inc Sun Jul 2 00:13:21 2000
@@ -5,7 +5,7 @@
  * Copyright (c) 1998,1999 Cameron Taggart (cameront <email protected>)
  * Modified by Guarneri carmelo (carmelo <email protected>)
  *
- * $Id: db_odbc.inc,v 1.1 2000/04/17 16:40:09 kk Exp $
+ * $Id: db_odbc.inc,v 1.2 2000/07/01 22:13:21 kir Exp $
  */
 
 class DB_Sql {
@@ -25,6 +25,11 @@
 
   var $Auto_Free = 0; ## set this to 1 to automatically free results
 
+ /* public: constructor */
+ function DB_Sql($query = "") {
+ $this->query($query);
+ }
+
   function connect() {
     if ( 0 == $this->Link_ID ) {
       $this->Link_ID=odbc_pconnect($this->Database, $this->User, $this->Password, $this->UseODBCCursor);
@@ -35,6 +40,15 @@
   }
   
   function query($Query_String) {
+
+ /* No empty queries, please, since PHP4 chokes on them. */
+ if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
+ return 0;
+
     $this->connect();
     
 # printf("<br>Debug: query = %s<br>\n", $Query_String);
Index: php-lib-stable/php/db_oracle.inc
diff -u php-lib-stable/php/db_oracle.inc:1.1 php-lib-stable/php/db_oracle.inc:1.2
--- php-lib-stable/php/db_oracle.inc:1.1 Mon Apr 17 18:40:10 2000
+++ php-lib-stable/php/db_oracle.inc Sun Jul 2 00:13:21 2000
@@ -4,7 +4,7 @@
  *
  * Copyright (c) 1998,1999 Luis Francisco Gonzalez Hernandez
  *
- * $Id: db_oracle.inc,v 1.1 2000/04/17 16:40:10 kk Exp $
+ * $Id: db_oracle.inc,v 1.2 2000/07/01 22:13:21 kir Exp $
  *
  */
 
@@ -108,6 +108,15 @@
   ## The unused QueryIDs will be recycled sometimes.
 
   function query($Query_String) {
+
+ /* No empty queries, please, since PHP4 chokes on them. */
+ if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
+ return 0;
+
       $this->connect();
       $this->lastQuery=$Query_String;
 
Index: php-lib-stable/php/db_pgsql.inc
diff -u php-lib-stable/php/db_pgsql.inc:1.3 php-lib-stable/php/db_pgsql.inc:1.4
--- php-lib-stable/php/db_pgsql.inc:1.3 Sat Jul 1 00:56:45 2000
+++ php-lib-stable/php/db_pgsql.inc Sun Jul 2 00:13:21 2000
@@ -5,7 +5,7 @@
  * Copyright (c) 1998,1999 SH Online Dienst GmbH
  * Boris Erdmann, Kristian Koehntopp
  *
- * $Id: db_pgsql.inc,v 1.3 2000/06/30 22:56:45 athompso Exp $
+ * $Id: db_pgsql.inc,v 1.4 2000/07/01 22:13:21 kir Exp $
  *
  */
 
@@ -32,6 +32,11 @@
           if("" != $add) return " ".$me.$add;
   }
   
+ /* public: constructor */
+ function DB_Sql($query = "") {
+ $this->query($query);
+ }
+
   function connect() {
           if ( 0 == $this->Link_ID ) {
                   $cstr = "dbname=".$this->Database.
Index: php-lib-stable/php/db_sybase.inc
diff -u php-lib-stable/php/db_sybase.inc:1.1 php-lib-stable/php/db_sybase.inc:1.2
--- php-lib-stable/php/db_sybase.inc:1.1 Mon Apr 17 18:40:15 2000
+++ php-lib-stable/php/db_sybase.inc Sun Jul 2 00:13:21 2000
@@ -9,7 +9,7 @@
  *
  * metadata() contributed by Adelino Monteiro <adelino <email protected>>
  *
- * $Id: db_sybase.inc,v 1.1 2000/04/17 16:40:15 kk Exp $
+ * $Id: db_sybase.inc,v 1.2 2000/07/01 22:13:21 kir Exp $
  *
  */
 
@@ -26,6 +26,11 @@
 
   var $Auto_Free = 0; ## Set this to 1 for automatic sybase_free_result()
 
+ /* public: constructor */
+ function DB_Sql($query = "") {
+ $this->query($query);
+ }
+
   function connect() {
     if ( 0 == $this->Link_ID ) {
       $this->Link_ID=sybase_pconnect($this->Host,$this->User,$this->Password);
@@ -39,6 +44,16 @@
   }
 
   function query($Query_String) {
+
+
+ /* No empty queries, please, since PHP4 chokes on them. */
+ if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
+ return 0;
+
     $this->connect();
 
 # printf("Debug: query = %s<br>\n", $Query_String);

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>