aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/database.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-28 11:10:31 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-28 11:10:31 +0000
commit6c12b4208f1c8c611a8c2325efbd95d12de6a49a (patch)
treeb2c7313d3bdaf1c63307e5cf2a2f0b04e5e8c08b /engine/lib/database.php
parent816f381791ed2fb993bcb070aac483bf15d36ea8 (diff)
downloadelgg-6c12b4208f1c8c611a8c2325efbd95d12de6a49a.tar.gz
elgg-6c12b4208f1c8c611a8c2325efbd95d12de6a49a.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Fixed $CONFIG->prefix now $CONFIG->dbprefix * Exception thrown on missing tables git-svn-id: https://code.elgg.org/elgg/trunk@734 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r--engine/lib/database.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index 1cc348574..f5e4c64db 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -116,7 +116,7 @@
{
global $CONFIG;
- $this->table = $CONFIG->prefix . sanitise_string($table);
+ $this->table = $CONFIG->dbprefix . sanitise_string($table);
$this->field = sanitise_string($field);
$this->order = sanitise_string($order);
}
@@ -154,9 +154,9 @@
{
global $CONFIG;
- $this->acl_table = $CONFIG->prefix . sanitise_string($acl_table);
+ $this->acl_table = $CONFIG->dbprefix . sanitise_string($acl_table);
$this->acl_field = sanitise_string($acl_field);
- $this->object_owner_table = $CONFIG->prefix . sanitise_string($object_owner_table);
+ $this->object_owner_table = $CONFIG->dbprefix . sanitise_string($object_owner_table);
$this->object_owner_id_field = sanitise_string($object_owner_id_field);
}
@@ -187,9 +187,9 @@
{
global $CONFIG;
- $this->table1 = $CONFIG->prefix . sanitise_string($table1);
+ $this->table1 = $CONFIG->dbprefix . sanitise_string($table1);
$this->field1 = sanitise_string($field1);
- $this->table2 = $CONFIG->prefix . sanitise_string($table2);
+ $this->table2 = $CONFIG->dbprefix . sanitise_string($table2);
$this->field2 = sanitise_string($field2);
$this->operator = sanitise_string($operator);
}
@@ -222,10 +222,10 @@
global $CONFIG;
$this->link_operator = sanitise_string($link_operator);
- $this->left_table = $CONFIG->prefix . sanitise_string($left_table);
+ $this->left_table = $CONFIG->dbprefix . sanitise_string($left_table);
$this->left_field = sanitise_string($left_field);
$this->operator = sanitise_string($operator);
- $this->right_table = $CONFIG->prefix . sanitise_string($right_table);
+ $this->right_table = $CONFIG->dbprefix . sanitise_string($right_table);
$this->right_field = sanitise_string($right_field);
}
@@ -256,7 +256,7 @@
global $CONFIG;
$this->link_operator = sanitise_string($link_operator);
- $this->left_table = $CONFIG->prefix . sanitise_string($left_table);
+ $this->left_table = $CONFIG->dbprefix . sanitise_string($left_table);
$this->left_field = sanitise_string($left_field);
$this->operator = sanitise_string($operator);
if (is_numeric($value))
@@ -472,6 +472,8 @@
$sql = trim($sql, ", ");
}
+ else
+ throw new DatabaseException("No tables specified for query.");
// Joins on select queries
if ($this->query_type->query_type == 'select')