No showing database rows with NO value in one column

Discussion in 'PHP' started by mnymkr, Aug 10, 2007.

  1. #1
    Man this is hard to explain

    I am filtering a database by php but i did not create the database, it is updated regularly

    we do not wish to show data if it has NO value for Color or Size , however if any other field like Comment has No value we wish to show that record

    can this be done

    and is it done on the php side or in the database?

    thanks
     
    mnymkr, Aug 10, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    SELECT * FROM yourtable WHERE color != '' AND size != ''
    
    Code (sql):
    Like this?
     
    nico_swd, Aug 10, 2007 IP