Reputation: 417
Is it possible to generate that SQL without hacking?
DELETE FROM product WHERE (type=1 AND deleted=1) OR (type=2 AND category=10);
Upvotes: 1
Views: 340
Reputation: 512
use this sample:
$db->delete(array('(type=1 AND deleted=1) OR (type=2 AND category=10)'));
or if you have a model class for each table so:
$model = new Product();
$model->delete(array('(type=1 AND deleted=1) OR (type=2 AND category=10)'));
Upvotes: 1