Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

searching cell for offerName!='' && offerName!=0...how to do that?

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
how do i write:

Code:
$stha = $dbha->prepare("select offerID from offers where ((offerType1 like '%$srchVar%')&&(offerType1 != ''))");

or

Code:
$sth = $dbh->prepare("select offerID, offerName, offerImgSmall, offerName2, offerType1, offerType2 from offers where ((offerType1 like '%$srchVar%')&&(offerType1 != '')) LIMIT $start, $results");

any ideas?

- g
 
if offertype1 is going to be like something non-empty (i.e. if $srchVar is not a zero-length string) then you don't really need to test for offertype1!=''

so all you need is
Code:
... where offertype1 like '%$srchVar%'
:)

rudy | r937.com | Ask the Expert | Premium SQL Articles
SQL for Database-Driven Web Sites (next course starts May 8 2005)
 
wow...i didn't even test before i posted this question, so i messed up. you can actually write the code as i wrote it, and it works fine. sorry for the inconvenience.

- g
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top