diff options
author | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 23:01:37 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 23:01:37 +0200 |
commit | 64cfbcf3dc766a5bbe80b74072c4686fd956bc53 (patch) | |
tree | 1b591b4cfcba99c4fbc7e9bfe1b36d29c991919d /Db.php | |
parent | b69995e1d0bcd5ea1185acfda4899e11f1d8e624 (diff) | |
download | main-64cfbcf3dc766a5bbe80b74072c4686fd956bc53.tar.gz main-64cfbcf3dc766a5bbe80b74072c4686fd956bc53.tar.bz2 main-64cfbcf3dc766a5bbe80b74072c4686fd956bc53.zip |
Timezone
Diffstat (limited to 'Db.php')
-rw-r--r-- | Db.php | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -67,12 +67,13 @@ class Db try { - $stmt = self::getInstance()->prepare($sql); + $pdo = self::getInstance(); + $stmt = $pdo->prepare($sql); $result = $stmt->execute($data); if (!$result) { - $e = $pdo->errorInfo(); - $error = $e[2] ."\n" . print_r(debug_backtrace(), true); + list($ec, $dec, $emsg) = $pdo->errorInfo(); + $error = $emsg ."\n" . print_r(debug_backtrace(), true); return App::error($error); } @@ -88,10 +89,11 @@ class Db } if (empty($data['id'])) { - $data['id'] = self::getInstance()->lastInsertId(); + $data['id'] = $pdo->lastInsertId(); } $out = array(); + // Always strip ":" prefixes from input array keys foreach ($data as $k => $v) { $key = ltrim($k, ':'); |