Re: Still having a problem with IF/ELSE Statement
| From: | Tom Rogers | Date: | Thu, 06 Mar 2003 13:01:31 +0000 |
| Subject: | Re: Still having a problem with IF/ELSE Statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138456@lists.php.net to get a copy of this message | ||
Hi,
Thursday, March 6, 2003, 10:31:58 PM, you wrote:
HJ> I want to tahnk those that responded to my previous post, seems I was doing
HJ> this all the wrong way. I am still having an issue with the syntax:
HJ> if("$status=='active'"){
HJ> echo("active line\n");
HJ> }else{
HJ> echo("inactive line\n");
HJ> };
HJ> When I display an employee record that has the employment status
HJ> $Row[status] of active, then the "active line" displays no problem, when I
HJ> display an employee record of an inactive employee, I still get the "active
HJ> line".
HJ> I have also tried to do it this way but to no avail:
HJ> if("$Row[status]=='active'"){
HJ> echo("active line\n");
HJ> }else{
HJ> echo("inactive line\n");
HJ> };
HJ> Not to mention numerous ways of adding/removing/changing double quotes and
HJ> single quotes around.
HJ> Any and all help would be greatly appreciated
HJ> Jess
You dont need quotes in the if bit just :
if($status == 'active'){
echo("active line\n");
}else{
echo("inactive line\n");
}
should work
--
regards,
Tom