From ea6b892922363aeac1ef7dbf0e17aecd64033071 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Mon, 4 Jan 2010 15:20:52 +0000 Subject: Handle table prefixes properly (at all, that is). --- helpers/randimg.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers/randimg.php b/helpers/randimg.php index 8917858..c682ea8 100644 --- a/helpers/randimg.php +++ b/helpers/randimg.php @@ -20,9 +20,10 @@ class randimg_Core { static function randimg_link() { $db = Database::instance(); + $table_prefix = $db->table_prefix; $query = " SELECT i1.name, i1.title, i1.description, i2.slug - FROM items i1 JOIN items i2 + FROM {$table_prefix}items i1 JOIN {$table_prefix}items i2 ON i1.parent_id = i2.id ORDER BY RAND() LIMIT 1; -- cgit v1.2.3