LifesGreatestGift
02-12-2013, 06:44 PM
Not sure how to start. I have a query that states,
$q = vB::$db->query_first("SELECT `thisdata`,`thisdata2` FROM `customtable` WHERE `threadid` = " . $threadid . ");
i then register it properly
vB_Template::preRegister('threadbit', array('q' => $q));
blah blah register
what hook should I use? threadbit_display?
how would I call the variable properly?
I've tried a number of things... :\
{vb:raw q.thisdata} {vb:raw thisdata} {vb:raw q} {vb:raw q, {vb:raw thread.realthreadid}} {vb:raw q.{vb:raw thread.realthreadid}.thisdata} {vb:raw q.thisdata, {vb:raw thread.realthreadid}} {vb:raw thread.q.thisdata}
I am unsure if my query is called once, or looped for each thread.id once or how to reference it in the threadbit template so it only prints the data for that threads "id".
any ideas? A few of those variables returned "Array" in the template, but I was unsure if it was an array of all threads or just the data that pertains to that specific thread.
--------------- Added 1360699547 at 1360699547 ---------------
nvm, figured it out. issue with query.
$q = vB::$db->query_first("SELECT `thisdata`,`thisdata2` FROM `customtable` WHERE `threadid` = " . $threadid . ");
i then register it properly
vB_Template::preRegister('threadbit', array('q' => $q));
blah blah register
what hook should I use? threadbit_display?
how would I call the variable properly?
I've tried a number of things... :\
{vb:raw q.thisdata} {vb:raw thisdata} {vb:raw q} {vb:raw q, {vb:raw thread.realthreadid}} {vb:raw q.{vb:raw thread.realthreadid}.thisdata} {vb:raw q.thisdata, {vb:raw thread.realthreadid}} {vb:raw thread.q.thisdata}
I am unsure if my query is called once, or looped for each thread.id once or how to reference it in the threadbit template so it only prints the data for that threads "id".
any ideas? A few of those variables returned "Array" in the template, but I was unsure if it was an array of all threads or just the data that pertains to that specific thread.
--------------- Added 1360699547 at 1360699547 ---------------
nvm, figured it out. issue with query.