Re: sort in while(list($vars) = mysql_fetch_row($result))

From: Date: Wed, 27 Feb 2008 15:27:47 +0000
Subject: Re: sort in while(list($vars) = mysql_fetch_row($result))
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-270306@lists.php.net to get a copy of this message
On 27-Feb-08, at 9:23 AM, Daniel Brown wrote:
On Wed, Feb 27, 2008 at 7:58 AM, Verdon Vaillancourt <verdonv@verdon.ca> wrote: [snip!]
Then I pass it through this.. while(list($id, $text, $url, $m_order) = mysql_fetch_row($result)) { $out .= "$text - $m_order \n"; } echo $out;
    Is there a reason you're not simplifying this to the following?
<? while($row = mysql_fetch_array($result)) {
    $out .= $row['text']." - ".$row['m_order']."\n";
} Hi Dan,
Thanks for the input. The only reason is that I'm inheriting this from someone else and am asked to do a 'quick' fix to get it working again. The whole script is a little kludgy and it may be better to redo it. Is there anything fundamentally wrong with the while(list()) approach, or is it just messy? Best rgds, vern

« previous php.general (#270306) next »