summaryrefslogtreecommitdiff
path: root/includes/database/database.inc
diff options
context:
space:
mode:
authorJennifer Hodgdon <yahgrp@poplarware.com>2014-03-04 08:31:39 -0800
committerJennifer Hodgdon <yahgrp@poplarware.com>2014-03-04 08:31:39 -0800
commit67401f398caa2f0a574dede100e21ae9f39c2057 (patch)
treeab0a258f94cb29a2105e178a49c991b72c40fc0a /includes/database/database.inc
parent627a891f5192f063025a2fa942b2e14598dca0f1 (diff)
downloadbrdo-67401f398caa2f0a574dede100e21ae9f39c2057.tar.gz
brdo-67401f398caa2f0a574dede100e21ae9f39c2057.tar.bz2
Issue #2194027 by KelvinWong, sphism: Fix up database topic docs example queries
Diffstat (limited to 'includes/database/database.inc')
-rw-r--r--includes/database/database.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index b375aa411..1bfb3f7d2 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -35,12 +35,14 @@
* For example, one might wish to return a list of the most recent 10 nodes
* authored by a given user. Instead of directly issuing the SQL query
* @code
- * SELECT n.nid, n.title, n.created FROM node n WHERE n.uid = $uid LIMIT 0, 10;
+ * SELECT n.nid, n.title, n.created FROM node n WHERE n.uid = $uid
+ * ORDER BY n.created DESC LIMIT 0, 10;
* @endcode
* one would instead call the Drupal functions:
* @code
* $result = db_query_range('SELECT n.nid, n.title, n.created
- * FROM {node} n WHERE n.uid = :uid', 0, 10, array(':uid' => $uid));
+ * FROM {node} n WHERE n.uid = :uid
+ * ORDER BY n.created DESC', 0, 10, array(':uid' => $uid));
* foreach ($result as $record) {
* // Perform operations on $record->title, etc. here.
* }