Forums

PHP

This topic is locked

the equivelent of IF THEN statements in ASP

Posted 30 Jan 2002 22:33:48
1
has voted
30 Jan 2002 22:33:48 Brent Hardinge posted:
What is the PHP equivelent of an IF THEN statement in ASP?

I am trying to say

If (Database Value) = 0 then
print "Active"
Else
print "Inactive"
end if

Can somebody point me in the right direction?

This is the Code that I have now:

<?php
if (.$staffdetails->Fields("inactive" = 0)
{
echo "Inactive";
} else {
print "Active";
}

?>

and I am receiving the following error:
parse error: parse error in /var/www/html/list/staff-detail.php on line 55

Line 55 is:
if (.$staffdetails->Fields("inactive" = 0)



Thanks
Brent



Edited by - dr_ducky on 30 Jan 2002 22:39:12

Edited by - dr_ducky on 30 Jan 2002 22:53:03

Replies

Replied 31 Jan 2002 00:16:20
31 Jan 2002 00:16:20 Tim Green replied:
Try:-

<?php
if ($staffdetails->Fields("inactive" = 0) {
echo "Inactive";
} else {
echo "Active";
}
?>


Instead...

You were nearly there, just an errant full stop really <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>

Reply to this topic