#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    15
    Rep Power
    0
    i'm modifying an existing bbs and i want to get the post to be ordered in a descending order ( i want the newset post to be first). The query is ...

    $sql2="select count(*) as count, max(date_format(fd_date,'%m-%d-%Y %H:%i') ) as max_date from forum_data where ftp_id=$ftp_id";

    ...i've tried adding ORDER BY max_date DESC to the end of the query but it doesn't work. can anyone help me?

    thanks in advance!
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    try order by fd_date desc instead because the formated date (max_date) might not sort correctly.

Similar Threads

  1. query syntax error
    By collegebloke in forum MS SQL Development
    Replies: 1
    Last Post: January 19th, 2004, 05:08 PM
  2. Overwriting mysql query with the query results
    By onerandomday in forum PHP Development
    Replies: 1
    Last Post: January 14th, 2004, 05:45 AM
  3. Syntax error in INSERT INTO query
    By Lee Miles in forum Visual Basic Programming
    Replies: 6
    Last Post: December 19th, 2003, 08:37 AM
  4. checkbox insert query
    By numb in forum PHP Development
    Replies: 11
    Last Post: December 15th, 2003, 12:10 PM
  5. Generating external js subcategory list from MySQL using PHP
    By NanoEntity in forum PHP Development
    Replies: 4
    Last Post: December 15th, 2003, 10:50 AM

IMN logo majestic logo threadwatch logo seochat tools logo