Re: Simple: Whats wrong with this?
| From: | Jake McHenry | Date: | Wed, 17 Mar 2004 17:56:00 +0000 |
| Subject: | Re: Simple: Whats wrong with this? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180718@lists.php.net to get a copy of this message | ||
I didn't post it, I just added on to someone elses question.
I do use counter++; in other scripts, but it's only in my timesheet app that
it doesn't work. It's very odd, so I just made them all $counter = $counter
+ 1; I didn't have time to mess with it. Was just asking.
$counter is initially set to 0, then after a mysql_query(), in the while
loop for mysql_fetch_array I was trying $counter++; like I do in my other
scripts. But in this case, it didn't work. I just wanted to see if anyone
knew why.
I'll try the pre increment. Maybe that'll work. It wasn't a big deal, as
long as it worked.
Jake
----- Original Message -----
From: "Adam Voigt" <adam@kotisprop.com>
To: "Shane McBride" <smcbride@rditech.net>
Cc: "PHP" <php-general@lists.php.net>
Sent: Wednesday, March 17, 2004 12:05 PM
Subject: RE: [PHP] Simple: Whats wrong with this?
> Well I accidentally deleted your original email, but I didn't see where
> you were getting the counter variable from. Where is the variable being
> stored? You do know that setting $counter++ for one visitor, doesn't
> translate the value of $counter to another, right?
>
> >
> > Does this always work? In my timesheet app, I have to do $counter =
$counter
> > + 1, because for some reason the $counter++; doesn't work. It just
doesn't
> > work, no incrementation of the variable. Is there something in php.ini
that
> > can prohibit this from working?
> >
> > Thanks,
> > Jake
> >