Welcome Guest, Not a member yet? Register   Sign In
require all values in array to be matched when using where_in
#9

[eluser]Andy UK[/eluser]
I'm very pleased to say i got it working after playing around with the solution CroNiX provided. Here is the active record/MySQL code:

Code:
// Features Filter
  if(is_array($this->session->userdata('selected_features')) && count($this->session->userdata('selected_features')) > 0)
  {
   $this->db->where_in('feat_prop_join.feature_id', $this->session->userdata('selected_features'));
   $this->db->having('count(distinct feat_prop_join.feature_id) = '. count($this->session->userdata('selected_features')), NULL, FALSE);
  }

The records are already grouped by the property.id further down


Messages In This Thread
require all values in array to be matched when using where_in - by El Forum - 08-28-2014, 09:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB