I need to do a mass delete from a MySQL table via PHP (using PDO). The table has a field called 'id' and all the id's to be deleted are stored in an array. There may be 5 rows to delete from the table or there may be 5000+.
My immediate thought is to use a foreach and iterate through the array deleting one at time. However something tells me that may not be a very good method if there are a lot of elements in the array.
Any thoughts on a best method for doing this type of delete?
IN:DELETE FROM table WHERE id IN (1,2,3,4,5)