phpOpenTracker/phpOpenTracker/Database/Driver MSSQL.php,1.4,1.5 MySQL.php,1.4,1.5 Oracle.php,1.4,1.5 PostgreSQL.php,1.4,1.5

Sebastian Bergmann <[email protected]>
Newsgroups gmane.comp.web.phpopentracker.cvs
Message-ID <[email protected]>
Update of /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/Database/Driver
In directory sc8-pr-cvs1:/tmp/cvs-serv10614/phpOpenTracker/Database/Driver

Modified Files:
	MSSQL.php MySQL.php Oracle.php PostgreSQL.php 
Log Message:
Flush.

Index: Oracle.php
===================================================================
RCS file: /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/Database/Driver/Oracle.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Oracle.php	22 Dec 2003 03:37:56 -0000	1.4
--- Oracle.php	3 Jan 2004 14:06:53 -0000	1.5
***************
*** 33,36 ****
--- 33,37 ----
  
      protected function disconnect() {
+         @OCILogOff($this->connection);
      }
  

Index: MSSQL.php
===================================================================
RCS file: /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/Database/Driver/MSSQL.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MSSQL.php	22 Dec 2003 03:37:56 -0000	1.4
--- MSSQL.php	3 Jan 2004 14:06:53 -0000	1.5
***************
*** 37,40 ****
--- 37,41 ----
  
      protected function disconnect() {
+         @mssql_close($this->connection);
      }
  

Index: PostgreSQL.php
===================================================================
RCS file: /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/Database/Driver/PostgreSQL.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PostgreSQL.php	22 Dec 2003 03:37:56 -0000	1.4
--- PostgreSQL.php	3 Jan 2004 14:06:53 -0000	1.5
***************
*** 34,45 ****
  
      protected function disconnect() {
!     }
! 
!     public function prepareString($string) {
!         return str_replace(
!           array("'",  '\\'),
!           array("''", '\\\\'),
!           substr($string, 0, 254)
!         );
      }
  
--- 34,38 ----
  
      protected function disconnect() {
!         @pg_close($this->connection);
      }
  
***************
*** 77,80 ****
--- 70,95 ----
  
      protected function debugQuery($query) {
+     }
+ 
+     public function quote($value) {
+         if (is_int($value) || is_double($value)) {
+             return $value;
+         } elseif (is_bool($value)) {
+             return $value ? 'TRUE' : 'FALSE';
+         } elseif (is_null($value)) {
+             return 'NULL';
+         } else {
+             return "'" . str_replace(
+               array(
+                 '\\',
+                 "'"
+               ),
+               array(
+                 '\\\\',
+                 "''"
+               ),
+               substr($value, 0, 254)
+             ) . "'";
+         }
      }
  }

Index: MySQL.php
===================================================================
RCS file: /cvsroot/phpopencounter/phpOpenTracker/phpOpenTracker/Database/Driver/MySQL.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MySQL.php	22 Dec 2003 03:37:56 -0000	1.4
--- MySQL.php	3 Jan 2004 14:06:53 -0000	1.5
***************
*** 20,26 ****
  
      protected function disconnect() {
!     }
! 
!     public function prepareString($string) {
      }
  
--- 20,24 ----
  
      protected function disconnect() {
!         @mysqli_close($this->connection);
      }
  
***************
*** 41,44 ****
--- 39,52 ----
  
      protected function debugQuery($query) {
+     }
+ 
+     public function quote($value) {
+         if (is_int($value) || is_double($value)) {
+             return $value;
+         } elseif (is_bool($value)) {
+             return $value ? 1 : 0;
+         } else {
+             return "'" . mysqli_real_escape_string(substr($value, 0, 254), $this->connection) . "'";
+         }
      }
  }




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.