Jess,
In your statement;
if("$status=='active'"){
the conditional inside quotations is treated as a string and not evaluated,
remove the outer double quotes :->
hope this helps,
Warren Vail
[EMAIL PROTECTED]
-----Original Message-----
From: Ray Hunter [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 8:02 AM
To: Hunter, Jess
Cc: PHP Mailing List
Subject: Re: [PHP] Still having a problem with IF/ELSE Statement
Maybe throw in the code where $status or $Row[status] get initialized.
but i would do it like this:
if( $status == 'active' ) {
echo "active line\n";
} else {
echo "inactive line\n";
}
or
if( $Row['status'] == 'active' ) {
echo "active line\n";
} else {
echo "inactive line\n";
}
One of those should work based on the code. However, based on the
variables $Row and $status that might not be the case.
--
Ray
On Thu, 2003-03-06 at 05:31, Hunter, Jess wrote:
> I want to tahnk those that responded to my previous post, seems I was
doing
> this all the wrong way. I am still having an issue with the syntax:
>
> if("$status=='active'"){
> echo("active line\n");
> }else{
> echo("inactive line\n");
> };
>
> When I display an employee record that has the employment status
> $Row[status] of active, then the "active line" displays no problem, when I
> display an employee record of an inactive employee, I still get the
"active
> line".
>
> I have also tried to do it this way but to no avail:
>
> if("$Row[status]=='active'"){
> echo("active line\n");
> }else{
> echo("inactive line\n");
> };
>
>
> Not to mention numerous ways of adding/removing/changing double quotes and
> single quotes around.
>
> Any and all help would be greatly appreciated
>
> Jess
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php