php - Select all records from one table and check them if they are common in 2nd table -


i want select records table , join table , check common records. problem if use inner join selects common records , if clause not true not select records first table. here sql

$stmt=$this->db->prepare("select * departamente inner join leg_dep_cand on leg_dep_cand.id_d=departamente.id_d  leg_dep_cand.id_c=:id_c");            $stmt->bindparam(":id_c",$id);         $stmt->execute();         $result = $stmt->fetchall();         return $result; 

select *  departamente  left outer join leg_dep_cand on leg_dep_cand.id_d=departamente.id_d       

in results missing records null.


Comments