Multiple database select - but print ids separately

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”] and $rs[“peronmedia.ID”]

but the codes don’t work

How can I do it?

Thank you.

Hi, welcome to phphelp.
Mysqli results doesn’t include the table name so you only need to use the column name:
$rs[“PID”]
$rs[“ID”]

Sponsor our Newsletter | Privacy Policy | Terms of Service