Friday, 15 May 2015

php - Show only rows that contain data in one specific column -



php - Show only rows that contain data in one specific column -

this question has reply here:

mysql select column not empty 8 answers

i have table contains thousands of rows. i'm trying show rows have info in specific column. column name "vhf" table name "p_loc". bulk of rows contain no info in column "vhf" but, when seek code below wants echo rows.

i need rows contain info in column "vhf"

$sql = mysql_query("select vhf p_loc vhf not null");

sounds there 2 cases want filter out:

the vhf column null the vhf column empty, or empty string

this means need 2 clauses in select:

$sql = mysql_query("select vhf p_loc vhf not null , vhf != ''");

php

No comments:

Post a Comment