Synkc
Active Member
- Messages
- 1,765
- Reaction score
- 0
- Points
- 36
I've been working on a News Management script for my website, which stores data in a MySQL database. Everything seems to be working perfectly, except for this small problem.
I'm trying to use the following syntax to retrive the first three rows from the database table "site_news" which have a value of "1" in the "show" column, arranged by a timestamp (the date it was posted) in descending order.
However, it doesn't seem to work. I'm just wondering whether it is actually possible to preform the action in a single query and whether the syntax I used is set out correctly.
Thanks to anyone who can help.
I'm trying to use the following syntax to retrive the first three rows from the database table "site_news" which have a value of "1" in the "show" column, arranged by a timestamp (the date it was posted) in descending order.
Code:
SELECT * FROM site_news WHERE 'show'='1' ORDER BY date_posted DESC LIMIT 3
However, it doesn't seem to work. I'm just wondering whether it is actually possible to preform the action in a single query and whether the syntax I used is set out correctly.
Thanks to anyone who can help.