I have categories and Listings stored in a ListingCategory table and a Listing table respectively.
A listing can be stored in many categories and a category can have many listings. These are joined by a table *ListingCategory_Listings*:
ID | ListingCategoryID | ListingID
I need to somehow grab all the ListingCategories where listings in them meet a certain criteria.
As an example, Imagine categories such as: Food, Drink, Lodging.
A bar listing would be linked to Food and Drink and a hotel would link to Food, Drink and Lodging, a hostel would link to lodging etc etc.
Each of these listings is geo-coded and I want to be able to display the categories where there are listings within X miles of a determined geo-location. So if just the bar fell within the X miles, we would show Food and Drink. If just the hostel fell in this radius, we only show lodging, etc. I have the logic to work out the distance, I just don’t know how to get my desired result
Lastly… apologies for the horrible post title
should be as simple as