I have a table with a column phone. The phones in it look like this: +1 (123) 456-3780. If the user enters "35" in the search field, I must show him all the users with the phones:
+3 (534) 000-1010
+1 (350) 000-9090
+1 (003) 534-2343
+1 (001) 223-5323 etc.
I tried to do something like this
SELECT * FROM `mytable` WHERE `phone` LIKE '%3%5'
but this is not the best solution, beacause the request to get other phones, such as +3 (000) 000-500.
I would like to use RLIKE or something like that, but don't know how to create a regular expression and how it should look like?
source
share