From 83c7a25a76efaf74467c6654f20be3a8029040d9 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Thu, 5 Jul 2007 07:13:25 +0000 Subject: missed some requires, tweaked the lastfm class and removed an unused function from general --- lib/class/dba.class.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'lib/class/dba.class.php') diff --git a/lib/class/dba.class.php b/lib/class/dba.class.php index b37ca39d..70bd47f5 100644 --- a/lib/class/dba.class.php +++ b/lib/class/dba.class.php @@ -34,6 +34,7 @@ class Dba { private static $_default_db; + private static $_sql; private static $config; /** @@ -53,7 +54,11 @@ class Dba { */ public static function query($sql) { + // Run the query $resource = mysql_query($sql,self::dbh()); + + // Save the query, to make debug easier + self::$_sql = $sql; return $resource; @@ -81,7 +86,9 @@ class Dba { $result = mysql_fetch_assoc($resource); - if (!$result) { return array(); } + if (!$result) { + return array(); + } return $result; @@ -96,7 +103,9 @@ class Dba { $result = mysql_fetch_row($resource); - if (!$result) { return array(); } + if (!$result) { + return array(); + } return $result; @@ -112,7 +121,9 @@ class Dba { $result = mysql_num_rows($resource); - if (!$result) { return '0'; } + if (!$result) { + return '0'; + } return $result; } // num_rows @@ -137,6 +148,7 @@ class Dba { if (!$dbh) { debug_event('Database','Error unable to connect to database' . mysql_error(),'1'); } $select_db = mysql_select_db($database,$dbh); + if (!$select_db) { debug_event('Database','Error unable to select ' . $database . ' error ' . mysql_error(),'1'); } return $dbh; -- cgit