Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
74bb4e2c
Commit
74bb4e2c
authored
Feb 27, 2014
by
Jennifer Hodgdon
Browse files
Issue
#2194027
by KelvinWong, sphism, danblack: Fix example query in database topic docs
parent
a2ee636f
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/includes/database.inc
View file @
74bb4e2c
...
...
@@ -39,12 +39,14 @@
* For example, one might wish to return a list of the most recent 10 rows
* authored by a given user. Instead of directly issuing the SQL query
* @code
* SELECT e.id, e.title, e.created FROM example e WHERE e.uid = $uid LIMIT 0, 10;
* SELECT e.id, e.title, e.created FROM example e WHERE e.uid = $uid
* ORDER BY e.created DESC LIMIT 0, 10;
* @endcode
* one would instead call the Drupal functions:
* @code
* $result = db_query_range('SELECT e.id, e.title, e.created
* FROM {example} e WHERE e.uid = :uid', 0, 10, array(':uid' => $uid));
* FROM {example} e WHERE e.uid = :uid
* ORDER BY e.created DESC', 0, 10, array(':uid' => $uid));
* foreach ($result as $record) {
* // Perform operations on $record->title, etc. here.
* }
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment