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 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 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 Share on other sites More sharing options...
Recommended Posts