Friday, 23 August 2013

Working with advanced php/mysql queries (Postcode Radius & Dates)

Working with advanced php/mysql queries (Postcode Radius & Dates)

I'm using php for an events calendar where I want to make it as
interactive as possible for the user to filter out the events. The problem
is when it comes to filtering by a geographical radius based on postcodes.
So there are several search criteria:
SELECT * WHERE (location, town, postcode) = (their answer) WHERE date =
Between - AND - ORDER BY date Desc // This is the easy one
SELECT * WHERE (WITHIN 10 Miles of Postcode given) + WHERE date = Between
- AND - ORDER BY date Desc // This is the dificult one.
Plus I may also need to add in another WHERE statement to filter out the
actual type of event.
Any ideas how this would be possible?

No comments:

Post a Comment