$q = $db->query("SELECT *
FROM people p
INNER JOIN job j
ON p.job_id = j.id
WHERE p.id = '$id'
ORDER BY j.id ASC");
$maps = array();
while($row = mysqli_fetch_array($q)) {
$product = array(
'id' => $row['id'],
'job_id' => $row['j.id']
)
}
table people
id
table job
id
In the above code I am doing an inner join between two tables. Both tables have an a column called id
is there a way to differentiate between the two in my while loop
?
I have tried the above but $row['j.id']
doesn't work and if I do $row['id']
then it writes both id
and job_id
with the same value.