note 29717 rejected from function.mysql-data-seek by betz

From: Date: Sun, 23 Feb 2003 00:21:30 +0000
Subject: note 29717 rejected from function.mysql-data-seek by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-44362@lists.php.net to get a copy of this message
$query = "SELECT headline, date FROM news ORDER BY date DESC LIMIT 5 "; $result = mysql_query($query) or die("Query failed: " . mysql_error()); /* fetch rows in reverse order */ for ($i = mysql_num_rows($result) - 1; $i >= 0; $i--) { if (!mysql_data_seek($result, $i)) { echo "Cannot seek to row $i: " . mysql_error() . "\n"; continue; } That puts the rows i want in reverse order, how do i put them in the right order like row8 first and thwn row 7 ans so on plz help me

« previous php.notes (#44362) next »