Commit 94408af976f720437636bf7459c1df34fb155a84

Authored by nbm
1 parent 282484ee

On compat queries, log query errors.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3191 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 7 additions and 3 deletions
lib/database/dbcompat.inc
... ... @@ -8,10 +8,14 @@ class DBCompat {
8 8 $aParams = $sQuery[1];
9 9 $sQuery = $sQuery[0];
10 10 }
11   - #$this->lastResult =& $default->_db->query($sQuery, $aParams);
12 11 $this->lastResult =& DBUtil::runQuery(array($sQuery, $aParams));
13   - $this->lastInsertID = mysql_insert_id($default->_db->connection);
14   - $this->lastResult->autofree = true;
  12 + if (PEAR::isError($this->lastResult)) {
  13 + $default->log->error("Error running query: " . DBUtil::lastQuery());
  14 + $default->log->error($this->lastResult->toString());
  15 + } else {
  16 + $this->lastInsertID = mysql_insert_id($default->_db->connection);
  17 + $this->lastResult->autofree = true;
  18 + }
15 19 return $this->lastResult;
16 20 }
17 21  
... ...