Bill
Try this:

while ($crow=mysql_fetch_array($cresult)) {
  $therow[]=$crow;
}
sort($therow);


André Cupini
Programador
[EMAIL PROTECTED]
NeoBiz - fábrica de internet
http://www.neobiz.com.br

  ----- Original Message ----- 
  From: bill 
  To: [EMAIL PROTECTED] 
  Sent: Monday, March 17, 2003 11:54 AM
  Subject: [PHP] sorting results in PHP


  I have a query that returns results including the fields Year, Month, and Day
  that I want to sort by date.

  Because of the nature of the query (it includes a GROUP BY statement), I cannot
  sort it in the query.

  How can I sort the results?

  I tried to use asort() while designating the field but that didn't work.

  while ($crow=mysql_fetch_array($cresult)) {
    $therow[]=$crow;
  }
  asort($therow["Year"]);
  reset($therow);
  asort($therow["Month"]);
  reset($therow);
  asort($therow["Day"]);
  reset($therow);

  ideas?

  kind regards,

  bill




  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to