This is only the query to take information from 3 tables
Select * from Listings,Locations,Category where Listings.location_id = Locations.location_id and Listings.category_id = Category.category_id ;
The full example of taking information from 2 tables are like that
$Attendance = array();
$query = "SELECT * FROM Temp,Student where Temp.SID = Student.SID ";
$result = mysqli_query($con, $query);
while ($row = mysqli_fetch_assoc($result))
{
$Attendance [$row['SID']] = array ("SID" => $row['SID'] , "CID" => $row['CID'] , "SName" => $row['SName'] , "TDate" => $row['TDate'] );
}
foreach ($Attendance as $i)
{
echo "".$i['SID'];
}
This will print to you the SID values .
You have to try the query at first if it work then continue withe code .