Justtechjobs.com Find a programming school near you






Online Campus Both


php4-beta | 200004

Re: [PHP4BETA] Problems with WHILE From: Frank M. Kromann (fmk <email protected>)
Date: 04/20/00

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 <email protected>
>For additional commands, e-mail: php4beta-help <email protected>
>To contact the list administrators, e-mail: php4beta-admin <email protected>
>
>
>

Swwwing A/S
Frank M. Kromann
VP Development
Phone: +45 70 20 77 20
Fax: +45 70 20 77 21
http://www.swwwing.com

-- 
PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
To unsubscribe, e-mail: php4beta-unsubscribe <email protected>
For additional commands, e-mail: php4beta-help <email protected>
To contact the list administrators, e-mail: php4beta-admin <email protected>