I have a table with postcode districts such as SA1,SA3,SA11, LL41,NP20 and I need to do a search based upon a customer entering a postcode, and then matching the relevant record, i’ve tried :
SELECT MATCH(postal_district) AGAINST ('SA1 1EG') FROM `postcodes` WHERE MATCH(postal_district) AGAINST ('SA1 1EG') > 0
but it returns nothing, what am I doing wrong?
Do you perhaps want to do something more like this?
I’m not sure a fulltext search is what you really want, either way, as you’d possibly be better served having one code per row and just doing a case-insensitive match (just compare the upper-case’d version of each). If you insist on using the above, make sure you have a fulltext index on the column you’re searching against (postal_district).