Skip to content

Instantly share code, notes, and snippets.

@mrsinguyen
Created June 10, 2010 07:18
Show Gist options
  • Save mrsinguyen/432670 to your computer and use it in GitHub Desktop.
Save mrsinguyen/432670 to your computer and use it in GitHub Desktop.
<?php
// Old code.
db_query("UPDATE {profile_field} SET weight = %d, category = '%s' WHERE fid = %d", $weight, $category, $fid);
// DBTNG.
db_update('profile_field')
->fields(array(
'weight' => $weight,
'category' => $category,
))
->condition('fid', $fid)
->execute();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment