Hello, I have table with phone number... I have to do a search query number Simple id number 1 123456 2 223344 3 9999 if I test with query: "SELECT* FROM`phones` WHERE number LIKE '%223344%'" find numbers - succeess! But if I select like this: "SELECT* FROM`phones` WHERE number LIKE '%059223344%'" Or "SELECT* FROM`phones` WHERE number LIKE '%223344111%'" Not found.... How do I find the number to the query? Perhaps REGEXP? Thank you!
For number LIKE '%223344111%'" do you want to find whether any combination of digits such as 223, 22334, 223344 is present in the table?
The question reveals low understanding for the mysql query. LIKE doesn't test to see if anything provided between the %signs are in the queried dataset, it tests to see if anything in the dataset contains the provided content - hence, if you want to search for any phone number containing 223 you search for that - you don't search for 223111. You limit the search with the minimal amount of input needed to find the results you need.