This is a script I have for a shoutbox -
$result = mysql_query("SELECT * FROM `shoutbox` ORDER BY `id` DESC LIMIT 5");
while($r=mysql_fetch_array($result))
{
$time=$r["time"];
$id=$r["id"];
$message=$r["message"];
$name=$r["name"];
echo "<div style='position:relative;'>";
echo $name." ".$message."<br/>".$time."<br/>";
echo "</div>";
}
The problem is that this code doesn't text-wrap and I tried adding text-wrap with no success. When I enter long text without spaces, the text gets out of the div. How can I fix this? And, as you might have noticed I have limited the number of messages by 5 using DESC LIMIT 5
I'd like to know how I can make the div scrollable so that when scrolled down more than the 5 messages earlier messages are shown.