dynamic table
Posted: Thu Aug 08, 2002 3:50 am
Hi.
I'm currently working on a hack for vB and have run into a sort of a problem. For those who don't know vBulletin uses templates for the html code and this is what brought my problem. I need to get a dynamically created table. Now the form for the content of the table is in a template,
I load that into $Inventoryform, and then do :
. Now the way I understood that would Go throw $itemsinfo row by row, always taking the $title, $description and $avatarpath an inserting them into the $Inventoryform variable, then adding inventoryform to itemlist, and then repeating that again. The thought was that this would create $Itemlist which would then contain the info from the db in as many rows and columns as needed. The final part would then be to call up $Itemlist and it would put in all the tables that it created.
This is where I get problems. It basically doesn't do that. So my question would be : How do I make that part of the table depending on the amount of data and have it stored in a variable that I can then use when I output all the stuff?
I'm currently working on a hack for vB and have run into a sort of a problem. For those who don't know vBulletin uses templates for the html code and this is what brought my problem. I need to get a dynamically created table. Now the form for the content of the table is in a template,
Code: Select all
<tr>
<td rowspan="2"><img src="$avatarpath"></td>
<td>$title</td>
</tr>
<tr>
<td>$description</td>
</tr>Code: Select all
while ($row = mysql_fetch_array($itemsinfo))
{
$title = $rowїtitle];
$description =$rowїdescription];
$avatarpath =$rowїavatarpath];
$Itemlist= $Inventoryform+$Itemlist;
}This is where I get problems. It basically doesn't do that. So my question would be : How do I make that part of the table depending on the amount of data and have it stored in a variable that I can then use when I output all the stuff?