I have tried everything and nothing is working. I have two tables. The parent table with the primary key and index is childcareinfo and the key is ChildcareID. The child table is users with the primary key of UserID and the foreign key of ChildcareID. The website is set to follow the user through the site using the MM_Username session variable. I have created the following query
SELECT *
FROM childcareinfo INNER JOIN users
ON childcareinfo.ChildcareID = users.ChildcareID
but the query pulls all the childcares and not just the childcare associated with the user. And then displays the information for the first record in the childcareinfo table and not the associated childcare. I researched and tried the query listed below, but I am told there is a syntax error.
SELECT *
FROM 'users' JOIN 'childcareinfo'
ON 'childcareinfo'.'ChildcareID' = 'users'.'ChildcareID'
Where 'users'.UserName' = $_SESSION[user]'
Thank you so much in advance. This has been the only stop in this website and has been ongoing for three long weeks. I need help to jump this hurdle. Cheers!