mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
db_Select_gen didn't return right result for some query types on PHP5
This commit is contained in:
@@ -12,9 +12,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
||||||
| $Revision: 1.9 $
|
| $Revision: 1.10 $
|
||||||
| $Date: 2007-04-12 08:10:20 $
|
| $Date: 2007-04-18 20:57:59 $
|
||||||
| $Author: lisa_ $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -27,8 +27,8 @@ $db_mySQLQueryCount = 0; // Global total number of db object queries (all db's)
|
|||||||
* MySQL Abstraction class
|
* MySQL Abstraction class
|
||||||
*
|
*
|
||||||
* @package e107
|
* @package e107
|
||||||
* @version $Revision: 1.9 $
|
* @version $Revision: 1.10 $
|
||||||
* @author $Author: lisa_ $
|
* @author $Author: e107steved $
|
||||||
*/
|
*/
|
||||||
class db {
|
class db {
|
||||||
|
|
||||||
@@ -517,18 +517,22 @@ class db {
|
|||||||
changes by jalist 19/01/05:
|
changes by jalist 19/01/05:
|
||||||
added string replace on table prefix to tidy up long database queries
|
added string replace on table prefix to tidy up long database queries
|
||||||
usage: instead of sending "SELECT * FROM ".MPREFIX."table", do "SELECT * FROM #table"
|
usage: instead of sending "SELECT * FROM ".MPREFIX."table", do "SELECT * FROM #table"
|
||||||
|
Returns result compatible with mysql_query - may be TRUE for some results, resource ID for others
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$this->tabset = FALSE;
|
$this->tabset = FALSE;
|
||||||
if(strpos($query,'#') !== FALSE) {
|
if(strpos($query,'#') !== FALSE) {
|
||||||
$query = preg_replace_callback("/\s#([\w]*?)\W/", array($this, 'ml_check'), $query);
|
$query = preg_replace_callback("/\s#([\w]*?)\W/", array($this, 'ml_check'), $query);
|
||||||
}
|
}
|
||||||
if ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Select_gen', $debug, $log_type, $log_remark)) {
|
switch ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Select_gen', $debug, $log_type, $log_remark))
|
||||||
|
{
|
||||||
|
case TRUE: return TRUE;
|
||||||
|
case FALSE :
|
||||||
|
$this->dbError('dbQuery ('.$query.')');
|
||||||
|
return FALSE;
|
||||||
|
default :
|
||||||
$this->dbError('db_Select_gen');
|
$this->dbError('db_Select_gen');
|
||||||
return $this->db_Rows();
|
return $this->db_Rows();
|
||||||
} else {
|
|
||||||
$this->dbError('dbQuery ('.$query.')');
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user