Jump to content

[SOLVED] if else...the bain of my existance! Grrr....hehe


NoDoze

Recommended Posts

if (isset($row['murl']))
echo "<a href=".$row['murl'] . ">more info</a>";
else
echo "<a href=".$row['mhover'] . ">more info</a>";

 

I think this is correct....but if the variable isn't present, it's NOT showin the mhover URL....what am I doing wrong?

 

I'm trying to do...

 

If variable is pesent in DB

do THIS

ELSE

Do THAT

 

Thanks!

First of all if is_null($var) is true, then empty($var) is true. There's no need to call both, especially when it's an OR statement.

 

yep. just re-read the man page for empty. sum-bitch. been coding redundancy into my first php app already. :) thanks for the info. gonna have to fix that in the next iteration.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.