title: How to display only rows that are not empty
body: <p>I have a small PHP mysql query looking at a table in my database. It's pulling all rows and then echoing out the record.</p>
  
  <p>Problem is I have a few empty rows in the table so what I get is a weird looking record.</p>
  
  <p>This is what I got:</p>
  
  <pre><code>&lt;?php
      $con = mysql_connect("localhost","username","password");
      if (!$con){
          die('Could not connect: ' . mysql_error());
      }
      mysql_select_db("username", $con);
      $result = mysql_query("SELECT * FROM wallnames2011 WHERE firstname IS NOT NULL");
      while($row = mysql_fetch_array($result)){
          echo $row['firstname'] . " - " . $row['city'] . ", " .$row['state'] . " &amp;nbsp;|&amp;nbsp; ";
      }
  ?&gt;
  </code></pre>
  
  <p>I want to keep the empty rows out.</p>