lazyseller
02-23-2009, 02:09 AM
How would i go about fetching the forumid the plugin is activated in and pass that variable into my query? Is this possible?
$listings = $vbulletin->db->query_read("SELECT title, threadid
FROM " . TABLE_PREFIX . "thread
WHERE forumid = 'variablehere'
ORDER BY rand() DESC
LIMIT 5
");
--------------- Added 1235378133 at 1235378133 ---------------
Got it working but just wanted to see if theres a better way to do this.
Is there a better way to do this?
$forumidtest = $foruminfo['forumid'];
$listings = $vbulletin->db->query_read("SELECT title, threadid
FROM " . TABLE_PREFIX . "thread
WHERE forumid = '$forumidtest'
ORDER BY rand() DESC
LIMIT 5
");
$listings = $vbulletin->db->query_read("SELECT title, threadid
FROM " . TABLE_PREFIX . "thread
WHERE forumid = 'variablehere'
ORDER BY rand() DESC
LIMIT 5
");
--------------- Added 1235378133 at 1235378133 ---------------
Got it working but just wanted to see if theres a better way to do this.
Is there a better way to do this?
$forumidtest = $foruminfo['forumid'];
$listings = $vbulletin->db->query_read("SELECT title, threadid
FROM " . TABLE_PREFIX . "thread
WHERE forumid = '$forumidtest'
ORDER BY rand() DESC
LIMIT 5
");