Posted by foripepe on February 2, 2010 at 4:25pm
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | documentation |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Page: http://api.drupal.org/api/group/database/7
Original text
INSERT INTO node (nid, title, body) VALUES (1, 'my title', 'my body')
one would instead write:
$fields = array('nid' => 1, 'title' => 'my title', 'body' => 'my body');
db_insert('my_table')->fields($fields)->execute();Last line doesn't seems good. I think this is a typo:
db_insert('node')->fields($fields)->execute();
Comments
#1
Correct, good catch. Patch attached to correct the api docs.
#2
Looks good. I concur with the logic of the reporter and patcher, and it's a good patch.
#3
Thanks, committed to HEAD.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.