0
Fala galera!
I have a table called tb_chat with the id_message fields,name,message,date,time.
how do I delete data from this table when it reaches '6' records?
0
Fala galera!
I have a table called tb_chat with the id_message fields,name,message,date,time.
how do I delete data from this table when it reaches '6' records?
0
Since it is not possible to run a delete using the same table in a subquery, you should do this in two steps:
First, you can select the first item of the tb_chat table based on the amount of records. This can be done in several ways, e.g.:
After that, just run delete with the ID returned from the query (if the query does not return any record, there are no more than 6 items in the table)
Browser other questions tagged php mysql
You are not signed in. Login or sign up in order to post.