Posts

Showing posts with the label multiple tags search

How To Perform Multiple Tags Search Inquiry Using Php, Mysql & Codeigniter?

I working on a tag based search. I accept 3 tables tag(id,name), tagXmedia(id,tag_id,media_id), as well as media(id,...). tagXmedia is the mapping tabular array betwixt the tag as well as media tables. This is a 1 to many relationship. For illustration I require to live on able to search for an entry inwards the media tabular array that is associated amongst both the "home" as well as "hawaii" tags. SELECT media_id FROM tagXmedia WHERE tag_id IN (SELECT id FROM tag WHERE get upwards IN ('home','hawaii')) GROUP BY media_id HAVING COUNT(tag_id) = 2; If y'all want to accept it agree to a greater extent than than but 2 tags, y'all tin easily add together them. Just retrieve to alter the 2 inwards the HAVING clause. Perform Multiple Tags Search using URL Parameters as well as Codeigniter Within the enquiry string, parameters (filters) are separated past times ampersands (&), as well as multiple values per parameter are separated past...