Download & Extend

Documentation problem with Database abstraction layer

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

Priority:normal» minor
Status:active» needs review

Correct, good catch. Patch attached to correct the api docs.

AttachmentSizeStatusTest resultOperations
dbdoc.patch763 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch dbdoc.patch.View details

#2

Status:needs review» reviewed & tested by the community

Looks good. I concur with the logic of the reporter and patcher, and it's a good patch.

#3

Status:reviewed & tested by the community» fixed

Thanks, committed to HEAD.

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.