Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need help in order by clause

    i want to select data from db order by date column and display the latest post first
    Code:
    $query = "SELECT * FROM jobs_uni limit $start, $per_page";
    //echo $query;
    $result = mysql_query($query);
    how to do this?

    i already use this way
    Code:
    $query = "SELECT * FROM jobs_uni limit $start, $per_page ORDER BY date DESC";
    and
    Code:
    $query = "SELECT * FROM jobs_uni  ORDER BY date DESC limit $start, $per_page";
    both are not working

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Add proper errors checks on your query to reveal the etrors in it, like
    PHP Code:
    $result=mysql_query($query) or die(mysql_error(). '<br><br>query : '.$query ); 
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •