Jump to content

Delete multiple records with one DELETE statement?


bulrush

Recommended Posts

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.