diff options
author | Andrew Dolgov <[email protected]> | 2011-12-13 14:49:11 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-12-13 14:49:11 +0400 |
commit | 5f0a3741d0a549849b503eca7b6d7b87d9903069 (patch) | |
tree | 58c0cef7a8a507fd138a987dc7d27a5a4d905f18 /include/db.php | |
parent | 46da73c255353a3f874d9742d7b2f9c64e7607b5 (diff) |
add Public_Handler
misc code cleanup
Diffstat (limited to 'include/db.php')
-rw-r--r-- | include/db.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/db.php b/include/db.php index 7a858ca70..1401c089b 100644 --- a/include/db.php +++ b/include/db.php @@ -61,7 +61,7 @@ function db_query($link, $query, $die_on_error = true) { if (!$result) { $query = htmlspecialchars($query); // just in case if ($die_on_error) { - die("Query <i>$query</i> failed [$result]: " . pg_last_error($link)); + die("Query <i>$query</i> failed [$result]: " . ($link ? pg_last_error($link) : "No connection")); } } return $result; @@ -70,7 +70,7 @@ function db_query($link, $query, $die_on_error = true) { if (!$result) { $query = htmlspecialchars($query); if ($die_on_error) { - die("Query <i>$query</i> failed: " . mysql_error($link)); + die("Query <i>$query</i> failed: " . ($link ? mysql_error($link) : "No connection")); } } return $result; |