diff options
author | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 23:02:33 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mekanisti.fi> | 2009-10-26 23:02:33 +0200 |
commit | 3036cdccec95ea8653f4925427a08c60e6233a36 (patch) | |
tree | 6bd77710cc61f66c7f6e410ed8a3db81b6a43e71 | |
parent | 730f91b3bab0767563184f99b40a851b6af6b635 (diff) | |
parent | 64cfbcf3dc766a5bbe80b74072c4686fd956bc53 (diff) | |
download | main-3036cdccec95ea8653f4925427a08c60e6233a36.tar.gz main-3036cdccec95ea8653f4925427a08c60e6233a36.tar.bz2 main-3036cdccec95ea8653f4925427a08c60e6233a36.zip |
Merge branch 'master' of github.com:filipp/main
-rw-r--r-- | App.php | 4 | ||||
-rw-r--r-- | Db.php | 10 |
2 files changed, 9 insertions, 5 deletions
@@ -15,7 +15,9 @@ class App { // Set custom error handler set_error_handler("App::error_handler"); - + // Set correct timezone + date_default_timezone_set(self::conf("app.timezone")); + @list($controller, $param, $action) = App::url(); if (empty($param)) { @@ -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, ':'); |