homepage Welcome to WebmasterWorld Guest from 54.227.41.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
how to find fileds that have a value only.
Only find populated fields.
ski442




msg:4092017
 11:53 am on Mar 5, 2010 (gmt 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

 

syber




msg:4092090
 2:42 pm on Mar 5, 2010 (gmt 0)

Does promotype contain nulls or blanks?

ski442




msg:4092113
 3:16 pm on Mar 5, 2010 (gmt 0)

Hi syber.
Sorry should have said.
Contains blanks,
Ski

LifeinAsia




msg:4092168
 4:32 pm on Mar 5, 2010 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved