How can I correct the problem I keep getting from the code below which states 'tahun_pemilihan' in where the clause is ambiguous. Thanks for the help in advance.
here is the MySQL table
$sql = "SELECT
a.*, b.vektor_v FROM data_alternatif a, hasil b
WHERE a.id_alternatif=b.id_alternatif AND tahun_pemilihan='$thn'";
Both tables contain a column named
tahun_pemilihanso in theWHEREclause condition it is not clear which table's column to use; should it use the one fromdata_alternatifor from the results tablehasil?Qualify the table in the
WHEREclause with eithera.tahun_pemilihan='$thn'if it should use columndata_alternatif.tahun_pemilihanorb.tahun_pemilihan='$thn'ifhasil.tahun_pemilihanis the one to use.