Skip to content

Instantly share code, notes, and snippets.

@aschanMarcus
Created July 2, 2014 13:42
Show Gist options
  • Select an option

  • Save aschanMarcus/06c8c6a6bef00fa7e028 to your computer and use it in GitHub Desktop.

Select an option

Save aschanMarcus/06c8c6a6bef00fa7e028 to your computer and use it in GitHub Desktop.
Enable comments for all nodes of a certain type.
$args = array(':type' => 'fitspirator');
$node = "UPDATE node AS n SET n.comment = 2 WHERE n.type = :type";
db_query($node, $args);
$node_revision = "UPDATE node_revision AS nr JOIN node AS n ON nr.nid = n.nid SET nr.comment = 2 WHERE n.type = :type";
db_query($node_revision, $args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment