Re: [PHP] help with "ORDER BY" query

2005-07-29 Thread John Nichel
Jesús Alain Rodríguez Santos wrote: I have a query: $query = mysql_query("SELECT event FROM table WHERE month = 'x' ORDER BY day ASC"); I have all days of the month insert in day field: 1, 2, 3, 4, 5 ... when I print the query: if ($query_r = mysql_fetch_array($query)) { -^

Re: [PHP] help with "ORDER BY" query

2005-07-29 Thread André Medeiros
if( mysql_num_rows( $query_r ) > 0 ) { while( $currentResult = mysql_fetch_array( $query_r ) ) { // do something with the result. } } else { echo 'No results.'; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/un

RE: [PHP] help with "ORDER BY" query

2005-07-29 Thread Carlo Razzeto
212 -Original Message- From: Jesús Alain Rodríguez Santos [mailto:[EMAIL PROTECTED] Sent: Friday, July 29, 2005 11:00 AM To: php-general@lists.php.net Subject: [PHP] help with "ORDER BY" query I have a query: $query = mysql_query("SELECT event FROM table WHERE month = 'x&

[PHP] help with "ORDER BY" query

2005-07-29 Thread Jesús Alain Rodríguez Santos
I have a query: $query = mysql_query("SELECT event FROM table WHERE month = 'x' ORDER BY day ASC"); I have all days of the month insert in day field: 1, 2, 3, 4, 5 ... when I print the query: if ($query_r = mysql_fetch_array($query)) { do { echo "".$query_r['event']."\n"; } while ($query_r