title: PHP - check if database column is empty
body: <p>How do I check if a database column is empty?</p>
  
  <p>I tried the following:</p>
  
  <pre><code>$check = "SELECT Name FROM data";
  $name = mysqli_query($con, $check);
  if(is_null($name) == true){
     //run this code 
  }
  </code></pre>
  
  <p>My method was to select the column "Name" and then checking if the column is return NULL or not. For some reason, the if statement runs when I put "is_null($name) == false" but my database definitely has no data in it so surely it should return true since it should be NULL. What am I doing wrong here?</p>
  
  <p>How can I check if the column of a database is empty using if statement?</p>
  
  <p>Thanks.</p>