RE: [PHP-DB] date: reverse order
| From: | Addison Ellis | Date: | Tue, 04 Feb 2003 13:01:14 +0000 |
| Subject: | RE: [PHP-DB] date: reverse order | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25407@lists.php.net to get a copy of this message | ||
thank you... this worked. best, addison
Simple MySQL. After your ORDER BY clause use either ASC (I think this is the default) or DESC. I'm pretty sure this'll work on date fields to produce the results you want. Your query will end up looking like: "...order by createdate DESC"-- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 addison@bellsouth.net info@smipco.com subsidiaries of small independent publishing co. info@gloabaldog.com info@momandpocentral.com-----Original Message----- From: Addison Ellis [mailto:addison@bellsouth.net] Sent: Tuesday, February 04, 2003 5:28 AM To: php-db@lists.php.net Subject: [PHP-DB] date: reverse order hello, when retrieving data from the db and displaying it on the page by creation date how can i reverse the order so that the most recent entry appears first? here's what i have now: <? require("config.php");-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php$obj = mysql_db_query($dbname,"select * from adsorder by createdate"); ?> thank you addison -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 addison@bellsouth.net info@smipco.com subsidiaries of small independent publishing co. info@gloabaldog.com info@momandpocentral.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php