I have a chat application I have been developing:
http://driptone.com/jony/applications/chat/index.php
Problem is, I am limiting results of messages at 30 messages maximum. I want new messages to overwrite, so the oldest messages will get deleted, from the top.
But for some reason, the messages on the bottom, which are the new ones, get deleted instead? By deleted I mean, won't show.
How can I change it?
I am ordering by date, time:
SELECT * FROM messages ORDER BY date, time ASC LIMIT 30
Inside while loop:
echo
'
<li>
<div class="messages">
<p>
'.$row['message'].'
</p>
<span class="user-meta">
'.$row['username'].'
</span>
<span class="time-meta">
'.$row['time'].', '.$row['date'].'
</div>
</div>
</li>
';
Any ideas?