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'] . " | "; } ?>
i want keep empty rows out.
try select column_name table_name trim(column_name) not null
Comments
Post a Comment