summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;