Forum Moderators: coopster

Message Too Old, No Replies

If then.

Can't get it to work

         

Pigbag

3:27 am on Feb 3, 2009 (gmt 0)

10+ Year Member



New to PHP and forum and i have searched extensively but cannot figure out what is wrong with this line of code.

<td><?php if ($row_rsRFI['Resolution'])== NULL) {echo &nbsp;} else {echo $row_rsRFI['Resolution'];} ?></td>

It is the implementation of the if that is causing the page to fail.

Cheer

Pigbag

sonjay

5:09 am on Feb 3, 2009 (gmt 0)

10+ Year Member




if ($row_rsRFI['Resolution'])== NULL) {
echo &nbsp;
} else {
echo $row_rsRFI['Resolution'];
}

Your if line has two closing parens but only one opening paren. Remove the extra closing paren.

Your echo &nbsp; needs quotation marks around the &nbsp;, and a closing ;


if ($row_rsRFI['Resolution'] == NULL) {
echo "&nbsp;";
} else {
echo $row_rsRFI['Resolution'];
}

If that doesn't fix your problem, then tell us what happens. What error message is output? If you're not displaying error messages, turn them on, then tell us what the error message is.

Or, if there's not an error message, tell us exactly what doesn't work. Don't just say it doesn't work. Tell us what it's expected to do, and what it is actually doing.

Pigbag

5:19 am on Feb 3, 2009 (gmt 0)

10+ Year Member



Thank you sonjay, it worked a treat.

You are quite right i should not have been so vague, however i was pretty sure it was just syntax.

Next time i will help you to help me!