I have the following code which has worked perfectly up until now:
$db->table = "horse_products as p";
$db->colums = "p.*, l.address as address, l.storename as supplier_name, c.title as cat_title, c.id_parent as id_parent";
$db->join = "LEFT JOIN locations as l ON l.id = p.id_location"
." LEFT JOIN categories as c ON c.id = p.id_category WHERE c.id_parent = 8";
$db->orderBy = "p.id_location ASC, p.id_product ASC";
$items = $db->Select();
Previously p.id_category was an integer because only one category within the 'categories' table was allowed to be associated with a product. However today I decided to make p.id_category a comma separated array. The downside to this is that when I try to echo $item['cat_title'], I only get the first c.title within the p.id_category array. I would like to get the title for all the categories within p.id_category. Can anyone help me here? I hope that I've made myself understood, as a MySQL novice even getting my LEFT JOIN's to work was a challenge :-)
EDIT:
Sat myself down this morning to find a solution and found it in the answer to the following question: MySQL: How to fetch data with left-join if column contains multiple ids?. Thanks to all that helped.