php-general | 2001092
Date: 09/30/01
- Next message: Richard Heyes: "[PHP] socket_get_status()"
- Previous message: Bob: "Re: [PHP] lock web page when editing"
- In reply to: Karl Nelson: "Re: [PHP] looping through database results"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Right, fetch-array just adds extra results to fetch-row.
Have you tried storing your results in an array that you can then loop
over later?
-----Original Message-----
From: Karl Nelson [mailto:karlnelson <email protected>]
Sent: Sunday, September 30, 2001 6:33 PM
To: elists <email protected>
Cc: php-general <email protected>
Subject: Re: [PHP] looping through database results
Thanks for your help, Andrew, but it didn't seem to work. As I read the
manual (http://www.php.net/manual/en/function.mysql-fetch-array.php),
mysql_fetch_array is much like mysql_fetch_row, except that it uses the
field names instead of numbers as the array key. Somebody correct me if
I'm
wrong...
Karl
Andrew Elliston wrote:
> Try using:
>
> while ($event_row = mysql_fetch_row($events))
>
> instead. mysql_fetch_row will grab one row of the result array at a
> time, until there are no more rows. This sounds like what you want.
What
> you were doing was grabbing the entire result array and storing them
in
> one variable.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Richard Heyes: "[PHP] socket_get_status()"
- Previous message: Bob: "Re: [PHP] lock web page when editing"
- In reply to: Karl Nelson: "Re: [PHP] looping through database results"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

