I have the following situation:
WhenIselectamarca
intabela
compatibility,IwanttoListallproductsintheProducttable,whosecodeisequaltotheselectedbrandcode.
Example:WhenselectingToyotayoushouldlistCabin,andselectingMazdashouldonlyreturnCabin
I'vedonethefollowing:
$marca=$this->input->post('marca');$marca=explode(',',$marca);$query=array();if(count($marcas)>0){$i=0;foreach($compas$row){$i++;if($row!=="")
{
if ($row !== "0")
{
$query[] = $row;
$this->db->where_in('marca', $query);
}
}
}
}
But with this code I can only get the products with the following table:
What can I program to map the two tables through the codigo
field?