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 Link to comment https://forums.phpfreaks.com/topic/99872-solved-search/ 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(). Link to comment https://forums.phpfreaks.com/topic/99872-solved-search/#findComment-511211 Share on other sites More sharing options...
jaymc Posted April 8, 2008 Author Share Posted April 8, 2008 Thanks, worked fine Link to comment https://forums.phpfreaks.com/topic/99872-solved-search/#findComment-512082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.