Let's say I have a postcode search where you can enter your postcode and search a MySQL Database. I want to be able to pull out the 6 closet postcodes to the postcode searched for...
What query would I have to run for this? I was thinking something like the below query but I don't think it would work because it would pull out practically any number not just the closet:
Code: Select all
SELECT * FROM postcodes WHERE postcode='4213' or postcode<='4213' or postcode>='4213' LIMIT 10Anyone have any ideas for me?