/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $type = 'YOUR CONTENT TYPE'; $aquery = db_query('SELECT n.nid FROM {node} n WHERE n.type = "%s"', $type); if(user_access('administer nodes')) { $count = 0; while ($n = db_fetch_object($aquery)) { node_delete($n->nid); echo $n->nid . 'deleted.'; $count++; } echo $count . 'nodes deleted'; } else { echo "No " . $type . " nodes found or you do not have permission to modify nodes."; } ?>
URL: http://drupal.org/node/92861