dynamic table

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DStroy
Forum Newbie
Posts: 1
Joined: Thu Aug 08, 2002 3:50 am

dynamic table

Post by DStroy »

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,

Code: Select all

<tr>
    <td rowspan="2"><img src="$avatarpath"></td>
    <td>$title</td>
  </tr>
  <tr> 
    <td>$description</td>
  </tr>
I load that into $Inventoryform, and then do :

Code: Select all

while ($row = mysql_fetch_array($itemsinfo))
	&#123;
	$title = $row&#1111;title];
	$description =$row&#1111;description];
	$avatarpath =$row&#1111;avatarpath];

	 $Itemlist= $Inventoryform+$Itemlist;
&#125;
. 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?
Post Reply