hi guys,
i should know how to do this but my brain just isnt on top form today..
I have a database table containing articles which are identified by an "articleID"
On the home page of the site I want to constantly display the top 5 articles.
How can I do this using sql?
This is what I have so far
This gets the latest articles and puts them in descending order based upon articleID which is set to auto increment in my database.
I think i could maybe limit it to five articles using the count function but just cant get it!
Any help would be cool
Thanks
J
i should know how to do this but my brain just isnt on top form today..
I have a database table containing articles which are identified by an "articleID"
On the home page of the site I want to constantly display the top 5 articles.
How can I do this using sql?
This is what I have so far
Code:
$result = mysql_query("SELECT * FROM announcements_test ORDER BY articleID DESC");
This gets the latest articles and puts them in descending order based upon articleID which is set to auto increment in my database.
I think i could maybe limit it to five articles using the count function but just cant get it!
Any help would be cool
Thanks
J