marcus Posted November 14, 2006 Share Posted November 14, 2006 i am making a shoutbox, and when i want to echo/print off the rows in the table it keeps printing thousands of commascode:[code]<?phpinclude('mysql.php');$sql = "SELECT * FROM shoutbox";$res1 = mysql_query($sql);echo "<tr><td>";echo "<div style='border:0px solid black; height:200px; width:130px; overflow:auto; font-family:verdana;font-size:10pt;color:black;'>";while("$res2 = mysql_fetch_assoc($res1), MYSQL BOTH"){printf ("<a href='$res2[website]'>$res2[name]</a><br>$res2[message]");};mysql_free_result($res1); ?>[/code]help? Link to comment https://forums.phpfreaks.com/topic/27168-mysql-help-needed/ Share on other sites More sharing options...
jcbarr Posted November 14, 2006 Share Posted November 14, 2006 Try this;[code]while($res2 = mysql_fetch_assoc($res1)){echo "<a href='$res2['website']'>$res2['name']</a><br>$res2['message']";};[/code] Link to comment https://forums.phpfreaks.com/topic/27168-mysql-help-needed/#findComment-124227 Share on other sites More sharing options...
marcus Posted November 14, 2006 Author Share Posted November 14, 2006 Yep, works perfectly now, thanks! Link to comment https://forums.phpfreaks.com/topic/27168-mysql-help-needed/#findComment-124230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.