If conditional behaviour

If conditional behaviour

am 16.11.2002 05:14:36 von Bradley Crockett

AT http://crockett.ca/joinoptional.php I have a page posted. PHP=
isn't set up on the server, so I've posted a screenshot of what=
it looks like at http://crockett.ca/joinoptionalrendered.bmp=
(1/2 MB, sorry). For some reason, it wants to repeat 'Victoria'=
in the form.

If I comment out the If conditional:

=09// if ($city =3D "Victoria") {
=09// echo "selected ";
=09// }

...the problem goes away and the different cities appear as=
expected.

The result of the query is at=
http://crockett.ca/queryresults.txt

Can someone point me in the right direction?

Brad Crockett
Duncan BC


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

Re: If conditional behaviour

am 16.11.2002 06:12:42 von Mihail Bota

Did you try $city=="Victoria" ?

On Fri, 15 Nov 2002, Bradley Crockett wrote:

> AT http://crockett.ca/joinoptional.php I have a page posted. PHP isn't set up on the server, so I've posted a screenshot of what it looks like at http://crockett.ca/joinoptionalrendered.bmp (1/2 MB, sorry). For some reason, it wants to repeat 'Victoria' in the form.
>
> If I comment out the If conditional:
>
> // if ($city = "Victoria") {
> // echo "selected ";
> // }
>
> ..the problem goes away and the different cities appear as expected.
>
> The result of the query is at http://crockett.ca/queryresults.txt
>
> Can someone point me in the right direction?
>
> Brad Crockett
> Duncan BC
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>


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

Re: If conditional behaviour

am 16.11.2002 06:17:07 von Bradley Crockett

That was it.

How embarrassing.

Thanks!

On Fri, 15 Nov 2002 21:12:42 -0800 (PST), Mihail Bota wrote:
>Did you try $city=="Victoria" ?
>
>On Fri, 15 Nov 2002, Bradley Crockett wrote:
>
>>AT http://crockett.ca/joinoptional.php I have a page posted.=
PHP
>>isn't set up on the server, so I've posted a screenshot of what=
it
>>looks like at http://crockett.ca/joinoptionalrendered.bmp (1/2=
MB,
>>sorry). For some reason, it wants to repeat 'Victoria' in the=
form.
>>
>>If I comment out the If conditional:
>>
>>    // if ($city =3D "Victoria") {
>>    // =A0echo "selected ";
>>    // }
>>
>>..the problem goes away and the different cities appear as
>>expected.
>>
>>The result of the query is at=
http://crockett.ca/queryresults.txt
>>
>>Can someone point me in the right direction?
>>
>>Brad Crockett
>>Duncan BC
>>
>>
>>--
>>PHP Database Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>



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

Re: If conditional behaviour

am 19.11.2002 04:39:59 von Evan Robinson

If you develop the habit of writing conditionals like this:

if ("Victoria" == $city)

instead of like this:

if ($city == "Victoria")

Your compiler (interpreter in PHP's case) will catch the assignment
vs. comparison error for you, because assigning to $city is valid but
assigning to a constant string "Victoria" isn't. Of course you'd
have to have display_errors On for PHP to report the problem....

Evan

At 9:17 PM -0800 on 2002.11.15, Bradley Crockett wrote about "Re:
[PHP-DB] If conditional behaviour":
>That was it.
>
>How embarrassing.
>
>Thanks!
>
>On Fri, 15 Nov 2002 21:12:42 -0800 (PST), Mihail Bota wrote:
>>Did you try $city=="Victoria" ?
>>
>>On Fri, 15 Nov 2002, Bradley Crockett wrote:
>>
>>>AT http://crockett.ca/joinoptional.php I have a page posted. PHP
>>>isn't set up on the server, so I've posted a screenshot of what it
>>>looks like at http://crockett.ca/joinoptionalrendered.bmp (1/2 MB,
>>>sorry). For some reason, it wants to repeat 'Victoria' in the form.
>>>
>>>If I comment out the If conditional:
>>>
>>>ÝÝÝÝ// if ($city =3D "Victoria") {
>>>ÝÝÝÝ// =DDecho "selected ";
>>>ÝÝÝÝ// }
>>>
>>>..the problem goes away and the different cities appear as
>>>expected.
>>>
>>>The result of the query is at http://crockett.ca/queryresults.txt
>>>
>>>Can someone point me in the right direction?
>>>
>>>Brad Crockett
>>>Duncan BC
>>>
>>>
>>>--
>>>PHP Database Mailing List (http://www.php.net/)
>>>To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>>
>>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


--

"The Engine of Mischief"
1976 GMC Eleganza II TZE166V100089

I do whatever the voices tell me to do.

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