Multiple database select - but print ids separately

$sql = "SELECT * FROM peron, peronmedia WHERE peronmedia.PID=5" and peron.ID=5"; $xc = mysqli_query($baglanti, $sql); $rs=mysqli_fetch_array($xc);

echo $rs["peron.PID"];
echo $rs["peronmedia.ID"];

but the codes don't work

How can I do it?

Thank you.