jaymc Posted April 6, 2008 Share Posted April 6, 2008 I am creating a postcode lookup tool, Im just wondering how to combat this little problem I have A postcode comes in this structure L12 8AK And thats how its stored in the database If someone types there postcode like this L128AK it will return 0 results The obvious is to have a tool tip or something giving them the format, but to go one further, how can I make mysql find the match regardless of whether they have entered a space demonstrated above Quote Link to comment Share on other sites More sharing options...
fenway Posted April 7, 2008 Share Posted April 7, 2008 You should simply do the comparison on a trimmed field value -- e.g. with replace(). Quote Link to comment Share on other sites More sharing options...
jaymc Posted April 8, 2008 Author Share Posted April 8, 2008 Thanks, worked fine Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.