Results 1 to 5 of 5

Thread: Sort by date

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    Sort by date

    In this code:

    $Sql = "select * from VisualBasicBank where BankID>=1";
    $Result = mysql_query($Sql);
    while ($Row = mysql_fetch_array($Result))
    {
    Echo "$Row[Date]";
    }

    I want to echo $Row[Date] but sorted by date.

    What can i add to $Sql to do that ?

    Thanks

  2. #2
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    change your $Sql statement to:

    $Sql = "select * from VisualBasicBank where BankID>=1 order by date asc";
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259
    Thank you too much

    But, please how to sort it by date (New date First)

  4. #4
    scoutt
    Guest
    cpradio had it right.

    use his and place DESC in place of ASC

    $Sql = "select * from VisualBasicBank where BankID>=1 order by date DESC";

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    ok

    Thank you toooooooooooooooooo much.

Posting Permissions

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



Click Here to Expand Forum to Full Width