The following query works for returning keywords (as a semicolon separated list), but only works if the service has keywords associated.
SELECT contacts.number, contacts.email, services.type, services.id, contacts.id, group_concat(keywords.word SEPARATOR ';') keywords
FROM contacts, capcodes, services, contacts_services, keywords, keywords_services
WHERE capcodes.code = '1908870'
AND services.capcode_id = capcodes.id
AND services.active = 1
AND contacts_services.service_id = services.id
AND contacts.id = contacts_services.contact_id
AND keywords_services.service_id = services.id
AND keywords.id = keywords_services.keyword_id;
Can we fix it so it returns phone numbers regardless of whether keywords are set or not? or should we set up a keyword that is assigned to all services as a hackish fix?
The following query works for returning keywords (as a semicolon separated list), but only works if the service has keywords associated.
Can we fix it so it returns phone numbers regardless of whether keywords are set or not? or should we set up a keyword that is assigned to all services as a hackish fix?