thesplatcat Posted April 2, 2007 Posted April 2, 2007 Am trying to use this contribution to show, on a forum side bar, the latest three products added to the shop. I have altered the SQL statement so where before it selected product-model, it now select products_date_added. That bit is fine, the only problem is its showing the first 3 products added rather than the last three. I assumed I needed to put DESC in there somewhere but have tried putting before the close quotes (e.g. three different places) and all the permutations of this and its just not happening. Below is the code which shows the "wrong" order, any help with how to change would be appreciated. // create SQL statement $sqlcount = "SELECT * FROM `products` ORDER BY 'products_date_added'"; $sql = "SELECT * FROM `products` ORDER BY 'products_date_added' LIMIT $pl, $num_products"; I have assumed that this is the part which needs altering but I could easily be wrong :-) Quote
gregy Posted January 6, 2008 Posted January 6, 2008 (edited) your post is the same to the last letter, i would have written now :))))) I also need last three .. DESC doesn't help Edited January 6, 2008 by gregy Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.