Answers for "drupal 7 db delete node programmatically based on condition"

0

drupal 7 db delete node programmatically based on condition

<?php

// Drupal 7
$nid = 5;
$num_deleted = db_delete('node')
  ->condition('nid', $nid)
  ->execute();

// Above example is equivalent to the following in Drupal 6
$nid = 5;
db_query("DELETE FROM {node} WHERE nid = %d", $nid);

?>
Posted by: Guest on December-04-2020

Code answers related to "drupal 7 db delete node programmatically based on condition"

Code answers related to "Javascript"

Browse Popular Code Answers by Language