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.

Sorry everyone. Found the problem. Thanx for all your trying. The problem
was a stupid error on my part - which they usually are.

The syntax of the IF statement was correct. I had the $_GET statement which
defined $vAnswer_ID_RS_PageContent below the IF in the script. Both of
these elements are in the <HEAD> so the display of the variables are below
this in the <BODY>. So, I was seeing variables containing the correct
values, but when the IF was executed, $vAnswer_ID_RS_PageContent had not
yet been defined.

Thanx again for your help.
-- 
Robb Kerr
Digital IGUANA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to