RE: [PHP] Simple: Whats wrong with this?

From: Date: Wed, 17 Mar 2004 17:16:15 +0000
Subject: RE: [PHP] Simple: Whats wrong with this?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-180704@lists.php.net to get a copy of this message
I am just trying to get the variable to increment, than I will be working on a session. It's basically being used to keep track of correct/incorrect answers for an online quiz. Here's what I am trying: if(!isset($correct)) { $correct = 0; } else { $correct++ } Shane -----Original Message----- From: Adam Voigt [mailto:adam@kotisprop.com] Sent: Wednesday, March 17, 2004 12:06 PM To: Shane McBride Cc: PHP 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? On Wed, 2004-03-17 at 12:05, Shane McBride wrote: > It doesn't seem to work either way for me. > > Shane > > -----Original Message----- > From: Jake McHenry [mailto:linux@nittanytravel.com] > Sent: Wednesday, March 17, 2004 12:01 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Simple: Whats wrong with this? > > > > No. > > > > $correct++; > > > > Is all you need for the second condition, it automatically sets itself > > back. > > > > > 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 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt adam@kotisprop.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#180704) next »