Hi
Ive been trying to do a calc count based on a values present in a multichoice drop down element. I have tried the following code but I assume because the element 'associated_fac' (the dropdown element) has data stored along the lines of 2,4,7 (or however) it does not equal the id number:
$db =& JFactory::getDBO();
$query1 = "SELECT COUNT(*) FROM 'designer_table' WHERE 'associated_fac' = '{factory_table___id}';
$db->setQuery($query1);
$query1 = $db->loadResult();
Is there a way (perhaps 'contains' or exactly equal to) that makes this code work?
Thank you in advance for any help.
Kind Regards
Ive been trying to do a calc count based on a values present in a multichoice drop down element. I have tried the following code but I assume because the element 'associated_fac' (the dropdown element) has data stored along the lines of 2,4,7 (or however) it does not equal the id number:
$db =& JFactory::getDBO();
$query1 = "SELECT COUNT(*) FROM 'designer_table' WHERE 'associated_fac' = '{factory_table___id}';
$db->setQuery($query1);
$query1 = $db->loadResult();
Is there a way (perhaps 'contains' or exactly equal to) that makes this code work?
Thank you in advance for any help.
Kind Regards