Re: Nested If...Else...

From: Date: Sat, 24 Jul 2004 16:24:23 +0000
Subject: Re: Nested If...Else...
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-191746@lists.php.net to get a copy of this message
On Sat, 24 Jul 2004 18:18:23 +0200, Marek Kilimajer wrote: > Robb Kerr wrote: >> On Sat, 24 Jul 2004 12:09:41 -0400, Scot L. Harris wrote: >> >> >>>On Sat, 2004-07-24 at 12:05, Robb Kerr wrote: >>> >>>>What's wrong with this syntax. I just can't see my mistake. >>>> >>>>if ($vBkgrndImage == "AnswerPage") { >>>> if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) { >>>> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg"; >>>> } else { >>>> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg"; >>>> } >>>>} >>>> >>>>Thanx >>> >>>Single quotes around CorrectAnswer? >>> >>>What is the error you are getting? >>> >>>Guessing that if it passes the syntax checks I expect your problem is it >>>is always evaluating to one of the options and not the other. >> >> >> You've got it. Syntax passes checking - always returns.. >> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg" >> >> Single quotes around 'CorectAnswer' is because that entry is in the style >> of table_recordset['field']. How else should this be coded? >> >> Thanx > > I think all column names are returned lowercased, so use > $row_RS_PageContent['correctanswer'] Nope. That just changed the return to always be the other option. -- Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams ---------------------------------------------------- http://www.digitaliguana.com http://www.cancerreallysucks.org

« previous php.general (#191746) next »