I have:
mysql_query("DELETE FROM mytable ORDER BY id DESC LIMIT 3, 999999999;")
or die(mysql_error());
But it doesn't seem to like it. I want to keep the most recent three rows and delete everything else. Thoughts?
Followup - thanks for the simultaneous jinx!
I tried the code and got this version error:
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
I checked my hosting and I have: MySQL version 5.5.36-cll-lve
I didn't expect this. What version do I need for limits? Is there another way to write this that will work?