Welcome to WebmasterWorld Guest from 54.145.167.92

Forum Moderators: open

Message Too Old, No Replies

how to find fileds that have a value only.

Only find populated fields.

   
11:53 am on Mar 5, 2010 (gmt 0)

5+ Year Member



Hi Guys.
I have done a search for my question but maybe useing wrong diescrption.

I have colunm called Promotype and certain products have different values and some are blank. I would like to be able to call just populated ones. Heres what i have.

$queryInfo = mysql_query("SELECT * FROM draper INNER JOIN drapernet ON drapernet.stockcode = draper.StkNumWHERE drapernet.promotype IS NOT NULL AND draper.catagory ='$catagory' ORDER BY stknum LIMIT $start, $limit");

it there a way for this
WHERE drapernet.promotype = 'true'
Thanks guys.
Ski442
2:42 pm on Mar 5, 2010 (gmt 0)

10+ Year Member



Does promotype contain nulls or blanks?
3:16 pm on Mar 5, 2010 (gmt 0)

5+ Year Member



Hi syber.
Sorry should have said.
Contains blanks,
Ski
4:32 pm on Mar 5, 2010 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Try:

$queryInfo = mysql_query("SELECT * FROM draper INNER JOIN drapernet ON drapernet.stockcode = draper.StkNum WHERE drapernet.promotype <>'' AND drapernet.promotype IS NOT NULL AND draper.catagory ='$catagory' ORDER BY stknum LIMIT $start, $limit");