Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-19-2014, 09:02 PM #1
- Join Date
- Oct 2009
- Thanked 3 Times in 3 Posts
how to search only letters and numbers in tables
I wish to know how google does their search, say there is a road called St. John's Road in my database and I type in my ajax-auto-sugestion field...
How can I get the auto-selection to show the road that is LIKE the content but do not use the . or the ' in the database
If I was to start to type...
then it would of course show the suggestion as I used the .
Can this be done ?
My fields have the proper names of the roads and I use utf8_general_ci for the road name field and the LIKE method to get the results.
04-17-2014, 02:26 PM #2
- Join Date
- Aug 2009
- Thanked 1 Time in 1 Post
Perhaps you could use the replace method, along the lines of:
I don't entirely know how the replace syntax works, so you may need to do a little research around it and see if it can suit the needs of your problem here.Code:SELECT * FROM tRoad WHERE replace(road, '.', '') LIKE '%searchterm%';
Last edited by Owener94; 04-17-2014 at 02:30 PM.