Mudsaf Posted April 5, 2012 Share Posted April 5, 2012 Im trying to make php script that gets data from sql and adds it to table, but i have one small problem. I want my table to have total of 8x td and then new row <tr>. Im using while ($row = mysql_fetch_array) { Adds the <td's>} Example. <tr> <td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr> So my point is that when the sql query gets information to table after every 8 information taken from sql it creates new tr. Link to comment Share on other sites More sharing options...
astralaaron Posted April 6, 2012 Share Posted April 6, 2012 Hi, just create some variable that counts the number of <td>'s you want. When it is reached, reset the number and echo out your </tr><tr> Link to comment Share on other sites More sharing options...
Mudsaf Posted April 6, 2012 Author Share Posted April 6, 2012 Thanks astralaaron everything works perfectly now Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.