Skip to content

Instantly share code, notes, and snippets.

@mrsinguyen
Created June 10, 2010 07:15
Show Gist options
  • Save mrsinguyen/432665 to your computer and use it in GitHub Desktop.
Save mrsinguyen/432665 to your computer and use it in GitHub Desktop.
<?php
// Old code.
$result = db_query("SELECT nid FROM {node} n WHERE n.type = '%s' AND n.status = %d", array('page', 1));
// DBTNG. Note that multiple
$result = db_query("SELECT nid FROM {node} n WHERE n.type = :type AND n.status = :status", array(
':type' => 'page',
':status' => 1,
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment