Jump to content

Archived

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

Mutley

if($row['.....) = nothing?

Recommended Posts

How do I use an IF statement to do, if there is NOTHING in the database?

I tried:

if(.....) = 0)

...but it looks for a '0' in the database?

Thanks. :D

Share this post


Link to post
Share on other sites
Actually you are assing $row['blah'] with zero with the posted code. You use use two equal signs together, or use the empty function to check whether the the variable holds an empty value.
[code=php:0]if(empty($row['field_name_here']))
{
    echo 'field_name_here is empty!';
}[/code]

Share this post


Link to post
Share on other sites
It's actually empty, not is_empty ;)

Share this post


Link to post
Share on other sites

×

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.