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)) {
-^
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
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&
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
4 matches
Mail list logo