Talk about it!
I have a table called tb_chat with the fields id, message, name, date, time.
How do I delete data from this table when I reach '6' records?
Talk about it!
I have a table called tb_chat with the fields id, message, name, date, time.
How do I delete data from this table when I reach '6' records?
Since you can not perform a delete using the same table in a subquery, you should do this in two steps:
First, you can select the first item in the tb_chat table based on the number of records. This can be done in several ways, eg:
After that, just execute the delete with the ID returned from the query (if the query does not return any records, there are only 6 items in the table)