On Sunday, September 30, 2001, at 02:45 PM, Karl Nelson wrote:

>   while ($event_row = mysql_fetch_array($events))
>    {
>    $event_day = $event_row["event_day"];
>    if ($event_day == $day)
>     {
>     $event_name = $event_row["event_name"];
>     print "$event_name\n";
>     }
>    }

> Since it seems to only loop through the while ($event_row =
> mysql_fetch_array($events)) statement once (instead of the 30 times I 
> want
> it to loop through), I figure the issue is that after the one loop,
> $event_row does indeed equal mysql_fetch_array($events).  So I try to 
> unset
> the $event_row after the loop, but that didn't work.  I even tried to 
> make
> $event_row into a variable variable name.  Couldn't get that to work 
> either.

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.

Hope this helps,
Andrew Elliston

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to