sort in while(list($vars) = mysql_fetch_row($result))
| From: | Verdon Vaillancourt | Date: | Wed, 27 Feb 2008 12:58:13 +0000 |
| Subject: | sort in while(list($vars) = mysql_fetch_row($result)) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-270278@lists.php.net to get a copy of this message | ||
Hi,
I'm running into some sorting issues using a while(list($vars) = mysql_fetch_row($result)). I can provide more code if needed, but thought I would try this little bit first to see if I'm missing a fundamental concept and not a detail.
In a nutshell, I have a query first..
$result = mysql_query("select id, text, url, m_order from menu where level = 2 && active = 1 order by m_order");
.. the result of this query is sorted correctly by m_order
Then I pass it through this..
while(list($id, $text, $url, $m_order) = mysql_fetch_row($result)) {
$out .= "$text - $m_order \n";
}
echo $out;
.. it is now no longer in the order it was in the query. In some results it is, in others it's not.
Am I missing something basic?
Thanks,
verdon
Ps. Please cc me if replying as I am on digest mode