UBB.Dev
Posted By: Shark5060 if ... then in PHP ?? - 04/29/2002 9:14 AM
hi.

i've al little problem (again laugh ) but this time REALLY in PHP.

[code][/code]so the Row "Status" is a MySQL DB Row.
I Want

if $row["Status"] = 1 then echo "Active" else echo "Inactive"

But I'm not a good programmer (i only know include in PHP laugh ), so could anybody help me ?

@LK If this is the wrong fourm again, so no fear to move laugh

thanks.
Posted By: LK Re: if ... then in PHP ?? - 04/29/2002 12:52 PM
if ($row["Status"] == 1) { echo "Active"; } else { echo "Inactive"; }

I think tipsy
Posted By: Shark5060 Re: if ... then in PHP ?? - 04/29/2002 2:19 PM
hmm this is a beginning, but hr only displays "Inactive", no matter what $row["Status"] is.

ähm here is the "compleate" part
[code][/code]
Posted By: LK Re: if ... then in PHP ?? - 04/29/2002 2:22 PM
Did I tell you to put "" before/after 1? Try without it, maybe

Also, I guess you can use:
if ($row["Status"] == 1) echo "Active" else echo "Inactive";
?
Posted By: Shark5060 Re: if ... then in PHP ?? - 04/29/2002 2:23 PM
no, because it's inside a HTML Part.

Without the "" I Tried too, but this didn't worked too.
Posted By: LK Re: if ... then in PHP ?? - 04/29/2002 2:34 PM
quote:
Originally posted by Shark5060:
no, because it's inside a HTML Part.

confused
Posted By: Shark5060 Re: if ... then in PHP ?? - 04/29/2002 2:38 PM
ehm ok other way....

when I whrite it WITHOUT the then the script will display "if($row["Status]........"
and WITH the it displays "Inactive". Better ?
Posted By: LK Re: if ... then in PHP ?? - 04/29/2002 2:39 PM
I meant to put the code above INSIDE tipsy
Posted By: Shark5060 Re: if ... then in PHP ?? - 04/29/2002 3:53 PM
I think you mean:

Code
[/code]and then in the other <? and ?>

[code]
but then I get the same result...
Posted By: LK Re: if ... then in PHP ?? - 04/29/2002 4:30 PM
Not really, I think I mean:
[code][/code]tipsy
Posted By: Shark5060 Re: if ... then in PHP ?? - 04/29/2002 4:32 PM
ehm laugh laugh laugh

Call me an idiot or something else...

My Script should connect to the Server first, before it makes "decicions" laugh

sorry...

and thanks for help.
© UBB.Developers