- private function error() {
- if($this->mysqli) {
- return $this->db->error;
- } else {
- return mysql_error($this->db);
- }
- }
-
- private function throwOrLog(Exception $ex) {
- if($this->exceptions) {
- throw $ex;
- } else {
- logger('dba: '.$ex->getMessage());
- }
- }
-
- /**
- * starts a transaction. Transactions need to be finished with
- * commit() or rollback(). Please mind that the db table engine may
- * not support this.
- */
- public function beginTransaction() {\r
- if($this->mysqli) {\r
- return $this->db->autocommit(false);\r
- } else {\r
- //no transaction support in mysql module...
- mysql_query('SET AUTOCOMMIT = 0;', $db); \r
- }\r
- }
-
- /**
- * rollback a transaction. So, rollback anything that was done since the last call
- * to beginTransaction().
- */
- public function rollback() {\r
- if($this->mysqli) {\r
- return $this->db->rollback();\r
- } else {\r
- //no transaction support in mysql module...
- mysql_query('ROLLBACK;', $db);\r
+ if($result === false)
+ $mesg = 'false';
+ elseif($result === true)
+ $mesg = 'true';
+ else {
+ if($this->mysqli)
+ $mesg = $result->num_rows . ' results' . EOL;
+ else
+ $mesg = mysql_num_rows($result) . ' results' . EOL;