I've looked this up here and on the web in general and not found an answer.
For reasons I'll not go into, I need to delete the top row from a mysql database table, then refresh the page.
The delete is always for the top row, and independent of the row's content, so doing a select where is useless.
Seems to me I should be able to call (in my php code) this:
mysql_deleterow(0); // delete the top row from the table
and be done with it. But oh no -- no such call that I can find.
Is there a way to just delete a table row independent of its content? (please reread above where I say 'for reasons I'll not go into' if you feel an urge to ask me 'Why do you want to do that?')
Will it work for you:
DELETE FROM your_table [ORDER BY field_name] LIMIT 1;
You can omit ORDER BY.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With