I have three tables:
people - peopleID, first name, and last name
date - dateID and date
attendance - attendance ID, peopleID, dateID
I want to show all the people who attended the meeting on a certain date.
I have tried the following query but it doesn't work:
$result= mysql_query ("
SELECT people.ID, people.fname, people.lname, attendance.attendanceID, attendance.peopleID, attendance.dateID, date.dateID, date.date FROM roster
WHERE date.date='072306'
INNER JOIN attendance ON people.ID=attendance.ID
INNER JOIN date ON attendance.dateID=date.dateID
") or die (mysql_error());
I'm getting the following error:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN attendance ON roster.peopleID=attendance.ID INNER JOIN dat
Why isn't this working? Any help is appreciated. Thanks for your help in advance