PHP和SQL INSERT JOIN 2表,标准错误

$rentingsquery = "SELECT * FROM TBL_rentings WHERE personId='$personId'
JOIN TBL_rentings ON TBL_properties.propertyId = TBL_rentings.propertyId
JOIN TBL_people ON TBL_rentings.personId = TBL_people.personId";
$rentingsResult=mysql_query($rentingsquery) or die ("Query to get data from TBL_properties failed: ".mysql_error());

This is the error I get when I execute the code in my web page:

enter image description here

What I'm trying to do is select only the 'rentings' where the personId = $personId, (as the current page is a page for each individual person), and display only those 'rentings'. Also in the code which I haven't posted I'm displaying data about the property which is related to that rent, hence why I'm trying to join the renting and properties table with propertyId so that I call the correct property's details off the database.

$rentingsquery = "SELECT * FROM TBL_rentings
    JOIN TBL_rentings ON TBL_properties.propertyId = TBL_rentings.propertyId
    JOIN TBL_people ON TBL_rentings.personId = TBL_people.personId
    WHERE personId='$personId'";
    $rentingsResult=mysql_query($rentingsquery) or die ("Query to get data from TBL_properties failed: ".mysql_error());

First of all try this, the where condition has to be after the joins. If there are other problems I will edit the answer

The next problem is that you are joining the same table, but you are joining it in an external field. A quick fix, if I am supposing correct, is that you wrongly joined with an unwanted table:

SELECT * FROM TBL_rentings
JOIN TBL_properties ON TBL_properties.propertyId = TBL_rentings.propertyId
JOIN TBL_people ON TBL_rentings.personId = TBL_people.personId
WHERE TBL_rentings.personId='$personId'