Hi Matt,
in your code unfortunately it's not clear how you are
outputting data from an array, so I'm not sure... but
try reset($rows) function - it will set internal
pointer of array to first element... Consult manual
for array functions, specially for reset().
HTH, let me know
Piotr
--- Matt Babineau <[EMAIL PROTECTED]>
wrote:
> After I output data from a query with a for() loop,
> It seems like I
> cannot reuse the array from the query any more. Do I
> have to requery the
> database for the same info so that I can add up the
> database columns?
>
> <?PHP
>
> $bgcolor = "Silver";
> $bgcount="0";
> for ($i=0; $i < 10; $i++ ) {
> if ($bgcount == 1) {
> $bgcolor = "White";
> $bgcount = $bgcount + 1;
> }
> else {
> $bgcount = "0";
> $bgcolor="EFEFEF";
> }
> $rows = mysql_fetch_array($result);
> ?>
> OUTPUT DATA HERE
> <?PHP
> }
> ?>
>
> After this has run, when I try to run another for()
> loop on the same
> $result using the $rows variable it doesn't work.
> Any ideas?
>
>
> Matt Babineau
> Freelance Internet Developer
> -----------------------------------------
> e: <mailto:[EMAIL PROTECTED]>
> [EMAIL PROTECTED]
> p: 603.943.4237
> w: <http://www.illuminatistudios.com/>
> http://www.illuminatistudios.com
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php