I have three tables. Users, Events and States. The User table has the user's state, the event table has the user's events and states table is just the 50 US states. What I want is to list the number of events per a state, while listing all the states. So:
ALABAMA
ALASKA
ARIZONA (1)
ARKANSAS
CALIFORNIA (22)
I got this so far:
SELECT *, COUNT(Users.State) FROM Events, Users
WHERE Events.DateEnd >= NOW()
AND Events.uid = Users.UID
GROUP BY Users.State
But I can't get it to have all the states with the number of events within the state. And again, the events table doesn't have the state. The events table is linked to the user table via a user id and the user table has the state.