I cant figure this one out. The problem is simple. I have a chat application, and don’t want long chat conversations to be send. So when a conversation gets to long (maybe 20 messages), the first messages start to get deleted.
I save the conversation in a text field in phpmyadmin and I use this format (^ and &) to determine who is the sender and what the message is:
^John&Hi
^Linda&Hi, how are you?
^John&All good! You?
^Linda&Same
Update:
$query = mysql_query("UPDATE conversations SET chat= CONCAT(COALESCE(chat,''), '$sendMessage') WHERE conversations='$id'");
Thanks in advance
Parse your conversation into an array and only use the top n items.
Or better still, put all the chat entries into a table (individually).