diff options
author | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 15:19:28 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 15:19:28 +0200 |
commit | b69995e1d0bcd5ea1185acfda4899e11f1d8e624 (patch) | |
tree | db0a875dad27749ee2c072028cec32f867268392 /Db.php | |
parent | 735c8bf38f0b1c66470fdff312eacfcc21ab8ae8 (diff) | |
download | main-b69995e1d0bcd5ea1185acfda4899e11f1d8e624.tar.gz main-b69995e1d0bcd5ea1185acfda4899e11f1d8e624.tar.bz2 main-b69995e1d0bcd5ea1185acfda4899e11f1d8e624.zip |
Some fixes
Diffstat (limited to 'Db.php')
-rw-r--r-- | Db.php | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -66,19 +66,20 @@ class Db } try { - + $stmt = self::getInstance()->prepare($sql); $result = $stmt->execute($data); if (!$result) { - $e = $stmt->errorInfo(); - exit(App::error($e[2])); + $e = $pdo->errorInfo(); + $error = $e[2] ."\n" . print_r(debug_backtrace(), true); + return App::error($error); } } catch (PDOException $e) { $error = $e->getMessage() . $sql; - App::log($error); - exit(App::error($error)); + $error .= "\n" . print_r(debug_backtrace(), true); + return App::error($error); } // Select statements need the query results @@ -90,8 +91,8 @@ class Db $data['id'] = self::getInstance()->lastInsertId(); } - // Always strip ":" prefixes from input array keys $out = array(); + // Always strip ":" prefixes from input array keys foreach ($data as $k => $v) { $key = ltrim($k, ':'); $out[$key] = $v; |