summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-01-04 15:20:52 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-01-04 15:20:52 +0000
commitea6b892922363aeac1ef7dbf0e17aecd64033071 (patch)
tree6caab924d991364019ac8d7cdaeda24d3b323675
parent02ad78baae7e66c6c3bb6b5a2a4fc28a15e370c4 (diff)
Handle table prefixes properly (at all, that is).
-rw-r--r--helpers/randimg.php3
1 files changed, 2 insertions, 1 deletions
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;