Skip to content

Instantly share code, notes, and snippets.

@chrisarusso
Created April 23, 2014 15:08
Show Gist options
  • Save chrisarusso/11219118 to your computer and use it in GitHub Desktop.
Save chrisarusso/11219118 to your computer and use it in GitHub Desktop.
<?php
$or = db_or();
$or->condition('n.type', 'doctor');
$or->condition('n.type', 'practice');
$and = db_and();
$and->condition('n.nid', '532', '<');
$qry = db_select('node', 'n');
$qry
->fields('n', array('nid'));
$qry
->condition($or)
->condition($and);
$res = $qry
->execute();
foreach ($res as $row) {
$nids[] = $row->nid;
}
node_delete_multiple($nids);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment