Alwandy
06-24-2013, 12:52 PM
Hey there, basically I'm making something for my group and currently being a newbie in VB Classes & hooks.
Anyways, I made a query that would fetch every row in the table which it does because when I do this.
$result = $db->query_read("SELECT * FROM uksfroster");
while ($fname = $vbulletin->db->fetch_row($result)){
echo $fname[1];
}
It displays them all but we know it requires to work with the template so I save it in $ffname like this.
$result = $db->query_read("SELECT * FROM uksfroster");
while ($fname = $vbulletin->db->fetch_row($result)){
$ffname = $fname[1];
}
$templater->register('firstname', $ffname);
And uses this in template,
<div class="blockbody">
<div class="blockrow">
{vb:raw firstname}
</div>
</div>
What happens is that only last piece of information get shown like this.
Lets say I got Alpha Bravo Charlie and I use row to show them all but in the end only Charlie comes out but I want Alpha and Bravo too.
What am I doing wrong?
Anyways, I made a query that would fetch every row in the table which it does because when I do this.
$result = $db->query_read("SELECT * FROM uksfroster");
while ($fname = $vbulletin->db->fetch_row($result)){
echo $fname[1];
}
It displays them all but we know it requires to work with the template so I save it in $ffname like this.
$result = $db->query_read("SELECT * FROM uksfroster");
while ($fname = $vbulletin->db->fetch_row($result)){
$ffname = $fname[1];
}
$templater->register('firstname', $ffname);
And uses this in template,
<div class="blockbody">
<div class="blockrow">
{vb:raw firstname}
</div>
</div>
What happens is that only last piece of information get shown like this.
Lets say I got Alpha Bravo Charlie and I use row to show them all but in the end only Charlie comes out but I want Alpha and Bravo too.
What am I doing wrong?