Re: $i vs. $r
| From: | Anthony Ettinger | Date: | Mon, 27 Mar 2006 21:48:43 +0000 |
| Subject: | Re: $i vs. $r | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232674@lists.php.net to get a copy of this message | ||
On 3/27/06, Kevin Murphy <php@stubborndonkey.com> wrote:
> Does anyone have a clue why using this code doesn't work:
>
> $i = 0;
>
> while ($row = mysql_fetch_array($result))
>
> {
> echo ("Blah blah blah");
> $i++;
> }
>
> but this code does?
>
> $r = 0;
>
> while ($row = mysql_fetch_array($result))
>
> {
> echo ("Blah blah blah");
> $r++;
> }
>
> I don't use $i anywhere else on the page.
>
> --
> Kevin Murphy
> Webmaster - Information and Marketing Services
> Western Nevada Community College
> www.wncc.edu
> (775) 445-3326
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
Just a guess, but looks like a scoping issue. That code doesn't show
any difference between the two.
--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html