php - How to display only rows that are not empty -


i have small php mysql query looking @ table in database. it's pulling rows , echoing out record.

problem have few empty rows in table weird looking record.

this got:

<?php     $con = mysql_connect("localhost","username","password");     if (!$con){         die('could not connect: ' . mysql_error());     }     mysql_select_db("username", $con);     $result = mysql_query("select * wallnames2011 firstname not null");     while($row = mysql_fetch_array($result)){         echo $row['firstname'] . " - " . $row['city'] . ", " .$row['state'] . " &nbsp;|&nbsp; ";     } ?> 

i want keep empty rows out.

try select column_name table_name trim(column_name) not null


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -