I'm trying to create a message system, and I wan't to make happend this:
When user send message, his message is stored in the database when "Sent Box" reaches limit of 15 when new messages are stored it should delete the oldest record to give space to the new!
I've tried a lot of solutions in the web but none worked :(
i think this may help
create a query to count no. of rows in the table
select count() from table.........
then while inserting a new message you check whether count is =15 or not. if it is then first execute the delete query as below-
delete from table_name where sentat=(select min(sentat) from table_name)
after that execute insert query.
I used this "ORDER BY sentat
DESC LIMIT 1"