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.
To eliminate the single quotes in the IF statement I altered the code like this... $vPageContentCorrectAnswer = $row_RS_PageContent['CorrectAnswer']; if ($vBkgrndImage == "AnswerPage") { if ($vPageContentCorrectAnswer != $vAnswerID_RS_PageContent) { $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg"; } else { $vBkgrndImage = "Bkgrnd-Body-Correct.jpg"; } } It still works the same. What's the deal? -- Robb Kerr Digital IGUANA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php