Jump to content

if($query <= 0)....


nathanmaxsonadil

Recommended Posts

I'm trying to get it to display something if there's nothing in the database

the current code I have now is

 

if($query <= 0) {
echo "<div id='posts'><h2>Nothing to display</h2>
<p>Sorry we don't have anything to display.<br/>Suscribe to our <a href='http://myurl.com/feednews'>rss</a> feed for updates!</p></div>";
} else {
//my code to execute if more that 0 in database
}

however that does not display anything even when there is 0 in the database

what should I use instead?

Link to comment
https://forums.phpfreaks.com/topic/64960-ifquery/
Share on other sites

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.