Re: [PHP4BETA] Problems with WHILE
| From: | Frank M. Kromann | Date: | Thu, 20 Apr 2000 06:58:44 +0000 |
| Subject: | Re: [PHP4BETA] Problems with WHILE | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-13778@lists.php.net to get a copy of this message | ||
Hi Flemming,
Actualy that is what I am doing:
while (($tempdata = mssql_fetch_row($RS)))
$data[] = $tempdata;
mssql_free_result($RS);
in this code the while loop will only cover the next line so the mssql_free_result() will not be
called until all rows has been fetched.
As you can se from the entire sample I have an outher loop running the same function 3 times. The
first two times everything works fine but the third time things are getting wired. Actualy the two
first calls to mssql_fetch_row in the third round is ok but the rest of the recordset can not be
fetched.
- Frank
>At 12:59 PM 4/19/2000, Frank M. Kromann wrote:
>>while (($tempdata = mssql_fetch_row($RS)))
>>$data[] = $tempdata;
>>*/
>>mssql_free_result($RS);
>
>Doing the free_result would get rid of the results of your select, so it
>wouldn't be there for the next fetch_row. Put it after the end of the while
>loop, instead.
>
>- Flemming
>
>
>
>
>--
>PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
>To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
>For additional commands, e-mail: php4beta-help@lists.php.net
>To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>
>
>
Swwwing A/S
Frank M. Kromann
VP Development
Phone: +45 70 20 77 20
Fax: +45 70 20 77 21
http://www.swwwing.com