How would I go about doing this? I already have an id field with auto increment and primary key. But yeah I need a script that does this. Everywhere I looked it just shows me how to delete single rows but never multiple rows in order.
You will want to LIMIT
your delete to 12 rows, you will want to set it so that it deletes WHERE
the id
is >=
to the id that it is due to start at.
If I want to delete 12 rows, starting at (and including) id
4, from table foo
:
DELETE FROM `foo` WHERE `id` >= 4 ORDER BY `id` ASC LIMIT 12