My current code is this:
$select = $this->select()
->from(array('r' => 'recipes'), $this->getAdapter()
->quoteInto("r.*, MATCH(title, directions) AGAINST(?) AS score", $searchText))
->where('MATCH(title, directions) AGAINST(?)', $searchText);
//SQL: SELECT r.*, MATCH(title, directions) AGAINST('chicken soup') AS `score` FROM `recipes` AS `r` WHERE (MATCH(title, directions) AGAINST('chicken soup'))
I want to add an additional WHERE clause for finding only recipes that contain a certain ingredient. The problem I am having comes from the fact that the ingredients table and my recipe table have a many-to-many relationship, with a connecting table ingredient_recipes that has the columns 'id', 'recipe_id', and 'ingredient_id'.
How do I do this?