aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/database.php41
1 files changed, 27 insertions, 14 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index ba3762a8d..17857bef6 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -128,7 +128,11 @@
}
if (empty($resultarray)) {
return false;
- }
+ }
+
+ if (mysql_errno($dblink))
+ throw new DatabaseException(mysql_error($dblink));
+
return $resultarray;
}
@@ -150,7 +154,11 @@
while ($row = mysql_fetch_object($result)) {
return $row;
}
- }
+ }
+
+ if (mysql_errno($dblink))
+ throw new DatabaseException(mysql_error($dblink));
+
return false;
}
@@ -169,12 +177,13 @@
$dbcalls++;
- if (mysql_query($query, $dblink)) {
- return mysql_insert_id($dblink);
- } else {
- return false;
- }
-
+ if (mysql_query($query, $dblink))
+ return mysql_insert_id($dblink);
+
+ if (mysql_errno($dblink))
+ throw new DatabaseException(mysql_error($dblink));
+
+ return false;
}
/**
@@ -193,7 +202,10 @@
$dbcalls++;
if (mysql_query($query, $dblink))
- return mysql_affected_rows();
+ return mysql_affected_rows();
+
+ if (mysql_errno($dblink))
+ throw new DatabaseException(mysql_error($dblink));
return false;
@@ -214,12 +226,13 @@
$dbcalls++;
- if (mysql_query($query, $dblink)) {
+ if (mysql_query($query, $dblink))
return mysql_affected_rows();
- } else {
- return false;
- }
-
+
+ if (mysql_errno($dblink))
+ throw new DatabaseException(mysql_error($dblink));
+
+ return false;
}
/**