diff options
Diffstat (limited to 'phpBB/db')
-rw-r--r-- | phpBB/db/mssql.php | 21 | ||||
-rw-r--r-- | phpBB/db/mysql.php | 13 | ||||
-rw-r--r-- | phpBB/db/odbc.php | 11 | ||||
-rw-r--r-- | phpBB/db/oracle.php | 27 | ||||
-rw-r--r-- | phpBB/db/postgres7.php | 11 |
5 files changed, 64 insertions, 19 deletions
diff --git a/phpBB/db/mssql.php b/phpBB/db/mssql.php index 393f5fdd24..abde3268cf 100644 --- a/phpBB/db/mssql.php +++ b/phpBB/db/mssql.php @@ -10,6 +10,15 @@ * ***************************************************************************/ +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + if(!defined("SQL_LAYER")) { @@ -114,10 +123,10 @@ class sql_db // performance compared to an 'in-built' limit // // Another issue is the 'lack' of a returned true value when a query is valid but has - // no result set (as with all the other DB interfaces). It seems though that it's + // no result set (as with all the other DB interfaces). It seems though that it's // 'fair' to say that if a query returns a false result (ie. no resource id) then the // SQL was valid but had no result set. If the query returns nothing but the rowcount - // returns something then there's a problem. This may well be a false assumption though + // returns something then there's a problem. This may well be a false assumption though // ... needs checking under Windows itself. // if(eregi("LIMIT", $query)) @@ -135,7 +144,7 @@ class sql_db $row_offset = 0; $num_rows = $limits[2]; } - + // $this->query_array[] = $query; @mssql_query("SET ROWCOUNT ".($row_offset + $num_rows)); @@ -185,7 +194,7 @@ class sql_db $this->query_limit_offset[$this->query_result] = -1; $this->query_limit_numrows[$this->query_result] = -1; } - else + else { // $this->query_array[] = $query; @@ -259,7 +268,7 @@ class sql_db $result = @mssql_num_rows($query_id) - $this->query_limit_offset[$query_id]; } else - { + { $result = @mssql_num_rows($query_id); } return $result; @@ -340,7 +349,7 @@ class sql_db } if($query_id) { - + if($this->query_limit_offset[$query_id] > 0) { if($this->query_limit_success) diff --git a/phpBB/db/mysql.php b/phpBB/db/mysql.php index ab558892e3..9922bc0615 100644 --- a/phpBB/db/mysql.php +++ b/phpBB/db/mysql.php @@ -1,6 +1,6 @@ <?php /*************************************************************************** - * mysql.php + * mysql.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group @@ -10,6 +10,15 @@ * ***************************************************************************/ +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + if(!defined("SQL_LAYER")) { @@ -38,7 +47,7 @@ class sql_db if($this->persistency) { $this->db_connect_id = @mysql_pconnect($this->server, $this->user, $this->password); - } + } else { $this->db_connect_id = @mysql_connect($this->server, $this->user, $this->password); diff --git a/phpBB/db/odbc.php b/phpBB/db/odbc.php index ee6ca446d5..4922939ee7 100644 --- a/phpBB/db/odbc.php +++ b/phpBB/db/odbc.php @@ -10,6 +10,15 @@ * ***************************************************************************/ +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + if(!defined("SQL_LAYER")) { @@ -130,7 +139,7 @@ class sql_db if(eregi("LIMIT", $query)) { preg_match("/^(.*)LIMIT ([0-9]+)[, ]*([0-9]+)*/s", $query, $limits); - + $query = $limits[1]; if($limits[3]) { diff --git a/phpBB/db/oracle.php b/phpBB/db/oracle.php index 8879567513..5c1c85fb84 100644 --- a/phpBB/db/oracle.php +++ b/phpBB/db/oracle.php @@ -1,6 +1,6 @@ <?php /*************************************************************************** - * oracle.php + * oracle.php * ------------------- * begin : Thrusday Feb 15, 2001 * copyright : (C) 2001 The phpBB Group @@ -10,6 +10,15 @@ * ***************************************************************************/ +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + if(!defined("SQL_LAYER")) { @@ -17,12 +26,12 @@ define("SQL_LAYER","oracle"); class sql_db { - + var $db_connect_id; var $query_result; var $row; var $num_queries = 0; - + // // Constructor // @@ -33,11 +42,11 @@ class sql_db $this->password = $sqlpassword; $this->server = $sqlserver; $this->dbname = $database; - + if($this->persistency) { $this->db_connect_id = @OCIPLogon($this->user, $this->password, $this->server); - } + } else { $this->db_connect_id = @OCINLogon($this->user, $this->password, $this->server); @@ -99,7 +108,7 @@ class sql_db $num_rows = $limits[2]; } } - + if(eregi("^(INSERT|UPDATE) ", $query)) { $query = preg_replace("/\\\'/s", "''", $query); @@ -246,10 +255,10 @@ class sql_db { $rows = @OCIFetchStatement($query_id, $results); @OCIExecute($query_id); - for($i = 0; $i <= $rows; $i++) + for($i = 0; $i <= $rows; $i++) { @OCIFetchInto($query_id, $tmp_result, OCI_ASSOC+OCI_RETURN_NULLS); - + for($j = 0; $j < count($tmp_result); $j++) { list($key, $val) = each($tmp_result); @@ -351,7 +360,7 @@ class sql_db return false; } } - + function sql_nextid() { if($this->db_connect_id) diff --git a/phpBB/db/postgres7.php b/phpBB/db/postgres7.php index b06123b167..fefc1fc01d 100644 --- a/phpBB/db/postgres7.php +++ b/phpBB/db/postgres7.php @@ -10,6 +10,15 @@ * ***************************************************************************/ +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + if(!defined("SQL_LAYER")) { @@ -19,7 +28,7 @@ class sql_db { var $db_connect_id; - var $query_result; + var $query_result; var $in_transaction = 0; var $row; var $rownum = array(); |