I currently have a family tree database. I get the data to display by doing:
$sql = "SELECT * FROM persons WHERE ref='$personID'";
This works nicely. However, I've recently added another table called census_data
. I'm trying to query this table at the same time as the persons table without success. I've tried doing this:
$sql = "SELECT * FROM persons, census_data
WHERE persons.$personID = census_data.$personID ";
The error I get says:
Unknown column 'persons.405' in 'where clause'.
I'm far from competent with databases, but this error seems to be talking about columns, while it is a row that I'm looking for. Obviously I've messed up.
How do I do this?