Working on a new Mod/Plugin for PR2
#1
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!
Reply
#2
That seems to be fine Smile
Reply
#3
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'");
Reply
#4
Thanks to both of you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)