aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/database.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-03 13:22:57 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-03 13:22:57 +0000
commitca4b43c0c94936a2592cb8a86a0631e4cd26d7af (patch)
tree9d55380970dc700b6e79ca2921eb589029913d2c /engine/lib/database.php
parent6263c4160e6067c4074d349e67f990c6e8130ddf (diff)
downloadelgg-ca4b43c0c94936a2592cb8a86a0631e4cd26d7af.tar.gz
elgg-ca4b43c0c94936a2592cb8a86a0631e4cd26d7af.tar.bz2
Installation issues: fixed
git-svn-id: https://code.elgg.org/elgg/trunk@57 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r--engine/lib/database.php18
1 files changed, 6 insertions, 12 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index fab73025e..1d78ac310 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -264,11 +264,12 @@
$tables = array();
- if (is_array($result)) {
+ if (is_array($result) && !empty($result)) {
foreach($result as $row) {
- foreach($row as $element) {
- $tables[] = $element;
- }
+ if (is_array($row) && !empty($row))
+ foreach($row as $element) {
+ $tables[] = $element;
+ }
}
}
@@ -306,13 +307,6 @@
$statement = str_replace("prefix_",$CONFIG->dbprefix,$statement);
if (!empty($statement)) {
$result = update_data($statement);
- if ($result == false) {
- $error = mysql_error();
- $error = trim($error);
- if (!empty($error)) {
- $errors[] = $error;
- }
- }
}
}
if (!empty($errors)) {
@@ -340,6 +334,6 @@
// Stuff for initialisation
- register_event_handler('init','system','init_db',0);
+ register_event_handler('boot','system','init_db',0);
?> \ No newline at end of file