bulrush Posted May 18, 2010 Share Posted May 18, 2010 Can I delete multiple records with one DELETE statement? Like this: DELETE FROM table WHERE id=1 or id=2; I guess my alternative is, can I execute 2 delete statements in one PHP query command? $query="DELETE FROM table WHERE id=1; "; $query.="DELETE FROM table WHERE id=2; "; $result=mysqli_query($dbc,$query); Link to comment https://forums.phpfreaks.com/topic/202186-delete-multiple-records-with-one-delete-statement/ Share on other sites More sharing options...
Mchl Posted May 18, 2010 Share Posted May 18, 2010 Yes you can. And no, the second one will not work. Only one query per one mysqli_query() call allowed. Link to comment https://forums.phpfreaks.com/topic/202186-delete-multiple-records-with-one-delete-statement/#findComment-1060218 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.