nathanmaxsonadil Posted August 21, 2007 Share Posted August 21, 2007 I have a html table and a database and I want a database to fill in the html table but I have to tr's here's my code $result = mysql_query('SELECT * FROM sites LIMIT 4') or die('Could not connect: ' . mysql_error()); while ($row = mysql_fetch_assoc($result)) { echo "<tr><td width='50%' valign='top'> <div> <a href='{$row['href']}'> <img style='border:0;' src='siteimg/{$row['img']}' alt='{$row['alt']}'/> <br/> {$row['url']} </a> </div> </td></tr>"; this works however it just has 1 tr for the whole list I want to have half in on tr and half in the other Link to comment https://forums.phpfreaks.com/topic/65903-solved-2-trs-in-a-query/ Share on other sites More sharing options...
trq Posted August 21, 2007 Share Posted August 21, 2007 So its not actually your query thats the problem? Take a look here. Link to comment https://forums.phpfreaks.com/topic/65903-solved-2-trs-in-a-query/#findComment-329447 Share on other sites More sharing options...
nathanmaxsonadil Posted August 21, 2007 Author Share Posted August 21, 2007 no Link to comment https://forums.phpfreaks.com/topic/65903-solved-2-trs-in-a-query/#findComment-329448 Share on other sites More sharing options...
sandy1028 Posted August 21, 2007 Share Posted August 21, 2007 try your query like this $result = "SELECT * FROM sites LIMIT 4"; $res=mysql_query($result); Link to comment https://forums.phpfreaks.com/topic/65903-solved-2-trs-in-a-query/#findComment-329568 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.