I am trying to delete all rows from a mysql database where the ID is not in my array. So I tried:
@mysql_query("DELETE FROM something WHERE NUMBER NOT IN (".implode(",", $array).")");
Somehow this doesnt do anything, is there a mistake I am not seeing?
Thanks for help!
phpheini
it seems that you don’t have any issue with the given code.
Put this before the sql execution.
As an example it will looks like..
And get the output. Then check it with mysql client. I think you don’t have any data to be deleted based on your query. Or there may be issues with relationships, foreign key, etc. However you can get exact issue if you try the query on mysql client tool.
Prasad.