OK, I got it to work somewhat when I added
WHERE (pp.PrayerDate = '$date'
to the bottom of the SQL statement.
Now, this has recreated another issue. I really don't know how to solve this problem. The have 3 tables in this database (time, user, prayer). Time has all the times one can pray during. User is just data about a user. Prayer is where I am storing information about when a person is going to pray.
What I am trying to do is when a person is signed up for a spot, to display their username. If nobody is signed up for this spot, I want it to say available. What it looks like is something like this:
12:00am Available
12:20am User1
12:40am User2
1:00am Available
and so on for the day.
With the SQL I have right now, it will only display where users have signed up for, but it will not show the times that are available. If I take out the WHERE statement, I will get all my time slots, but the same user will be displayed no matter what day I select. So the above example will display on every day, not just on the day that person is praying on.
Could someone help point me in the right direction on how to solve this problem?
Thanks for your time and help.