I have a table structured as follows:
address_number address_street address_town address_county address_postcode
There is a search box on the site where people can enter a partial address and I need to work out how to return accurate results based on the information they submitted, BUT there are a few complications the post code is stored like this: BN2 1HN and the address_number
can be as small as just 1 character.
I have tried to CONCAT
the address fields together and compare that to the input but none of it is working, I also tried going through each of the fields in the table with a LIKE
Loop but that was not satisfactory at all. Ideally I would like the most accurate results returned first but I appreciate this can only really be done with MATCH AGAINST
.
Any help would be greatly appreciated and a definitive answer will get you a drink if you have a PayPal Donate button (Providing etiquette allows for this?). Its my first question as I am stubborn and normally like to puzzle this stuff out for myself.