events have two locations: last location, current location
if someone subscribe for events going to happen in current location by selecting country/state/city, how do we check if the event should be send to the subscriber?
user can subscribe for events by selecting last location / new location. each location can be country only, country & state or country & State & city for both selection. Both locations can be left blank and subscribe for categories only.
when an user subscribe for events
userlocations table updated. it has the userid, and the six fields for locations.
if the subscriber select only "Current country" then other fields would be empty.
the question is how do we check if the event should be sent to the subscriber?
what is the logic?
have the query to select the users who are subscribed for events from user table
while there is a subscriber
select * from events
WHAT COMES NEXT?