Welcome to WebmasterWorld Guest from 54.145.55.135

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)

Junior Member

5+ Year Member

joined:Mar 31, 2007
posts: 53
votes: 0


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)

Preferred Member

10+ Year Member

joined:Nov 12, 2004
posts:393
votes: 0


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

Junior Member

5+ Year Member

joined:Mar 31, 2007
posts: 53
votes: 0


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

Moderator from US 

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

joined:Dec 10, 2005
posts:5628
votes: 48


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");