Sunday, December 12, 2010

Standardized Query to insert an record in Drupal 7

db_insert('tablename')
->fields(array(
'field1' => 'mystring',
'field2' => 5,
))
->execute();
?>

No comments:

Post a Comment