gwolff2005 Posted April 14, 2009 Share Posted April 14, 2009 Hi guys I need your help. I need a code saying. If row "x", "y", "z" of table "user" in database" "guntmar" is empty display the following text "is empty" otherwise display the content as a graph.. How can i do that? Link to comment https://forums.phpfreaks.com/topic/154050-mysql-query-if-empty/ Share on other sites More sharing options...
runnerjp Posted April 14, 2009 Share Posted April 14, 2009 <?php $sql = "Select foo FROM bar"; $postsresult = mysql_query($sql) or die("Could not get threads"); $num = mysql_num_rows($postsresult); if($num < 1){echo 'is empty';}else{ echo 'show graph';} ?> Link to comment https://forums.phpfreaks.com/topic/154050-mysql-query-if-empty/#findComment-809814 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.