MyBB Community Forums

Full Version: Working on a new Mod/Plugin for PR2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone!
I am working on a new mod/plugin for PR2 and I would like some help with part of it. I need a basic mysql script that pulls data off an existing table and shows it on a page. I think I have seen something like this before in some mods, and I think this is what I need:
Quote:$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE tid='".intval($mybb->input['tid'])."' AND visible='1'");

Am I at all on the right track, and could someone please point me in the right direction if not? Thanks in advance!
That seems to be fine Smile
Yep, thats right. And too makes things faster, draw only the bits you need. eg:
$query = $db->query("SELECT tid,subject,views FROM ".TABLE_PREFIX."threads WHERE tid='".intval($mybb->input['tid'])."' AND visible='1'");
Thanks to both of you!