jjjhbj111 wrote:
> Hi my search results are working except for a very
important part of only
> showing those that are active, set by admin.
> It is showing results event if they are inactive.
Rewrite the WHERE clause like this:
WHERE listingf.status = 'active' AND
(listingf.classbusinessname LIKE '%SearchString%'
OR listingf.inv_addr1 LIKE '%SearchString%'
OR listingf.classcatid LIKE '%SearchString%'
OR listingf.categorytype LIKE '%SearchString%'
OR listingf.inv_state LIKE '%SearchString%'
OR listingf.inv_addr2 LIKE '%SearchString%'
OR listingf.tel LIKE '%SearchString%')
Notice that the section after AND is enclosed in parentheses.
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/