summaryrefslogtreecommitdiffstats
path: root/lib/class/dba.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-05 07:13:25 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-05 07:13:25 +0000
commit83c7a25a76efaf74467c6654f20be3a8029040d9 (patch)
treeaa90f459c74d7d1ec8ba38fa4077873ed4f65dd8 /lib/class/dba.class.php
parentedf482ff3d21c84d99f25b84884563a8781fa7ae (diff)
downloadampache-83c7a25a76efaf74467c6654f20be3a8029040d9.tar.gz
ampache-83c7a25a76efaf74467c6654f20be3a8029040d9.tar.bz2
ampache-83c7a25a76efaf74467c6654f20be3a8029040d9.zip
missed some requires, tweaked the lastfm class and removed an unused function from general
Diffstat (limited to 'lib/class/dba.class.php')
-rw-r--r--lib/class/dba.class.php18
1 files changed, 15 insertions, 3 deletions
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;