![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| "Jon Kraft" <jon@jonux.co.uk> wrote in message news:Xns93B860F936347jonjonuxcouk@130.133.1.4... > "Adi" <admin@NOSPAMadigaskell.org> wrote: > > > I'm currently running a sql select statement on a date field which is > > ordered by the date field in ascending order. It worked fine for the > > 1st to the 9th of the month but when it output 10th, 11th, 12th etc. > > it put them before the 1st. So I was getting: > > > > 10th > > 11th > > 12th > > 1st > > 2nd > > .... > > > > my query is: > > > > $totalquery = "SELECT click, search, shop, DATE_FORMAT(date, '%D %b, > > %Y') AS date FROM donation_totals ORDER BY date ASC LIMIT 7" > > Don't use the field name as alias: > > $totalquery = "SELECT click, search, shop, DATE_FORMAT(date, '%D %b, %Y') > AS formattedDate FROM donation_totals ORDER BY date ASC LIMIT 7" > > JOn That works a treat, thanks. | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: date, order |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| readdir() order | Tim Hussein | PHP | 3 | 07-01-2007 3:36 PM |
| sort order | Kurt Milligan | PHP | 2 | 07-01-2007 3:35 PM |
| Halo 2 Pre-order | Andy | Console Subjects | 1 | 06-26-2007 11:01 AM |
| Order by column from other table | Pawel Ratajczak | Database | 3 | 06-26-2007 12:08 AM |
| Order By Problem | Jeff Grossman | Database | 5 | 05-31-2007 8:47 PM |
| Featured Websites | ||||
|