Here is the MySQL query to find formatted phone number by a differently formatted search text
People enter phone number in various formats on the web. Some people just write down the number without space or hyphens. Some does with ( brackets etc.
Sometimes we have to store it as it is to keep the clients /user happy. But its pain when you want to verify the number or do a search with number by entering entirely a different format. Following MySQL query helps you do it with ease.
It strips off all symbols and spaces from the data which is there in entire phone number data in your db and matches it with the query text you enter.
SELECT * FROM bizz_business_user WHERE TRIM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(phone, ' ', '' ), '-', '' ), ',', '' ), '/', '' ), '(', '' ), ')', '' ), '+46', '0') ) = '2403473649'
Hope this helps you to do awesome things with phone numbers.
For a long time since Push notification became a thing on iOS, it was very simple to integrate push notification…
Note: A little bit of a story since I haven't been writing for a while. If you are in a…
There are few things that are quite as universally important in a business like marketing. Good marketing is at the…
Since latest iOS and macOs removed support for PPTP VPN from their built in client, here is how you can…
Back to habits of young days. Shaping up another life. Starting like a kid who is a great king.
Today, when I logged in to my pc & open Chrome, I saw this nice Google Doodle for New Year’s…
View Comments
helpful :)
this method is indeed slow(not n hour late :P) .Use "SELECT * FROM `table`
WHERE `numberes` REGEXP '1[() -]*9'" (when you search '19')
Note You need a [() -]* between each input character.Expected data:+1 (003) 534-2343