PHP error on joining table says not unique table or alias -


i don't know how fix thing little good.

error : table/alias not unique.

why got error? believe why joins correct.please help

 $q = "select * `curriculum` "    . "inner join `subject` on `curriculum`.`subject`=`subject`.`sub_id` "    . "left join `subject` on `curriculum`.`cur_pr`=`subject`.`sub_id` "    . "where `course`=:cid , `cur_year`=1"; 

change code to

 $q = "select * `curriculum` "    . "inner join `subject` b on `a`.`subject`=`b`.`sub_id` "    . "left join `subject` c on `a`.`cur_pr`=`c`.`sub_id` "    . "where `course`=:cid , `cur_year`=1"; 

if want join same tables again use table aliases here as used purpose


Comments