diff options
| author | Yousha <Yousha.A@Hotmail.com> | 2012-08-30 20:05:27 +0430 |
|---|---|---|
| committer | Yousha <Yousha.A@Hotmail.com> | 2012-08-30 20:05:27 +0430 |
| commit | 55470a7ac82c49e30c5439344379e877ab1e7898 (patch) | |
| tree | 373654355f5045acebdbe549417f277663c774d8 /inc/database.php | |
| parent | fb4e28c7b86c8e8b1716eea38ad7c6d39172a2c9 (diff) | |
Improved.
Diffstat (limited to 'inc/database.php')
| -rw-r--r-- | inc/database.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/inc/database.php b/inc/database.php index 84185ad1..0dcc66b2 100644 --- a/inc/database.php +++ b/inc/database.php @@ -73,6 +73,7 @@ function prepare($query) { if ($config['debug']) return new PreparedQueryDebug($query); + return $pdo->prepare($query); } @@ -93,19 +94,19 @@ function query($query) { 'time' => '~' . $time ); return $query; - } else { - return $pdo->query($query); } + + return $pdo->query($query); } function db_error($PDOStatement=null) { global $pdo; + if (isset($PDOStatement)) { $err = $PDOStatement->errorInfo(); return $err[2]; - } else { - $err = $pdo->errorInfo(); - return $err[2]; } -} + $err = $pdo->errorInfo(); + return $err[2]; +} |
