I need some help solving a problem with MySQL, is it possible to pass an array to a function and then run a match against the array values?
I have this query
public function getMenu($cookieId)
{
$this->db->select('*');
$this->db->from('categoryTable');
$this->db->join('userMenuTable', 'categoryTable.categoryId = userMenuTable.categoryId', 'left');
$this->db->where('userMenuTable.cookieId', $cookieId);
$query = $this->db->get();
return $query->result_array();
}
Using the $query array that is returned is possible to query the database and get all the values from a table that do not match the array values?
$query? I have not used CI myself, but understanding how the array is returned would help in answering how you can call the query.result_array()? Or do you mean that$cookieIdmight contain an array? Are we talking about adjusting this query or creating a new query? Is it desirable extend this query by filtering on a subquery (or appending another JOIN)? By the way, you can passcategoryIdas a long string and CodeIgniter will createUSING categoryIdas the JOINing condition.