Hopefully somebody can clear this up for me...
I've got a news table setup, adds and edits, yadda yadda. Now I wanted this thing to have itself automatically prune...so that when it displays the news, it will first delete any records in the table that are numbered higher than x. So, thinking I had it all figured out, I created the table with auto-increment (id int unsigned auto_increment), and then I am running
mysql_query("DELETE FROM news WHERE id>=$newsCount") or die("Unable to DELETE record from News Database : ".mysql_error());
(and I am using a test record number of 4)
However, it deletes everything, since the recordset numbering does not restart at 1, but goes on up after a deletion...15, 16, 17, instead of deleting to 4, and then recounting from 4 to 5, 6, 7...see what I mean?
Can anyone explain to me what I need to do our should be doing?