Re: how to reinitialise an MySQL_fetch_array

From: Date: Sat, 15 Dec 2001 15:00:50 +0000
Subject: Re: how to reinitialise an MySQL_fetch_array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-77905@lists.php.net to get a copy of this message
Use the function mysql_data_seek(result variable, row number) so in your case it would be: mysql_data_seek($result2, 0); You should also consider suppressing the warning for an empty set by placing a '@' in front of the function ----- Original Message ----- From: "Ivan Carey" <icarey@iname.com> To: <php-general@lists.php.net> Sent: Saturday, December 15, 2001 7:32 AM Subject: [PHP] how to reinitialise an MySQL_fetch_array Hello, I would like to reinitialise an MySQL_fetch_array. That is, once it has gone through I would like to be able to go back to the start again. for eg while ($myrow=MySQL_fetch_array($result2)) { $befid=$myrow["beforeid"]; while($myrow5=MySQL_fetch_array($result5)) { $aftid=$myrow["afteridid"]; if ( $befid == aftid) { do something; } } //while($myrow5=MySQL_fetch_array($result5)) //now that the inner loop has finished I would like to be able to restart the inner loop by reinitailsing the MySQL_fetch_array } //while ($myrow=MySQL_fetch_array($result2)) Regards, Ivan

« previous php.general (#77905) next »