views:

35

answers:

1

Hello,

My search query is something like this

SELECT files.id,files.file,files.name,files.uid,files.size,files.downloads,files.deleted,files.descr,
files.upload_id,files.thumb,files.category,files.expirydate,

MATCH(name,descr) AGAINST ('$all $none $any' In BOOLEAN MODE) AS score, users.`user`            

FROM files Inner Join users ON files.uid = users.id 

WHERE MATCH(name,descr) AGAINST ('$all $none $any' IN BOOLEAN MODE) AND files.deleted =  0  ORDER BY score DESC

In this $all $none $any is the keywords inputed by user to search.

I want to narrow down the search results based on categories so how the query should be written for this.

I tried adding something like this after AND files.deleted = 0 AND category= 'Other' this works fine but just incase if the users has selected two categories to search in this doesnt work, I use AND category= 'Other' AND category = 'Images'

Thank You.

+1  A: 
... files.deleted = 0 AND category IN('Other','Images')
Emil Vikström
Thank You...very much
Shishant