Searching in mysql db with narrow results

enlaniano

New Member
My search query is something like this\[code\]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\[/code\]In this \[code\]$all $none $any\[/code\] 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 \[code\]AND category= 'Other'\[/code\] this works fine but just incase if the users has selected two categories to search in this doesnt work, I use \[code\]AND category= 'Other' AND category = 'Images'\[/code\]Thank You.
 
Back
Top