ORDER BY DESC
| From: | Chris Stinemetz | Date: | Mon, 20 Jun 2011 19:56:04 +0000 |
| Subject: | ORDER BY DESC | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-47860@lists.php.net to get a copy of this message | ||
I have the bellow sql query. What is the correct way to add ORDER BY
posts.post_date DESC
I would like to add it to the end of my query, but I am just getting a
blank page or my added "query doesn't work" echo:
"The posts could not be displayed, please try again later."
The query is:
//fetch the posts from the database
$posts_sql = "SELECT
posts.post_store,
posts.post_content,
posts.post_date,
posts.post_by,
users.user_id,
users.user_name
FROM
posts
LEFT JOIN
users
ON
posts.post_by = users.user_id
WHERE
posts.post_store = " . mysql_real_escape_string($_GET['id']);
Thank you in advance for your help.
Chris