I have a mysql database table which struction is:
startphoneNum | endphoneNum | department
022589893232011 | 022589893232021 | sales
022589893232027 | 022589893232029 | Human Resources
022589893232041 | 022589893232048 | after sales
the phone number is made by 3 parts: 022(city code)- 589893232(company number) – 011(extension number)
I could use php explode, make a phone number from the format 022-589893232-011 to 022589893232011, then how to put phone number via a mysql query to get the department name?
For example:
If I put a phone number 022589893232043, it belongs to after sales,
But how to make a php mysql query in code? and get the result what I need? Thanks.
Use a BETWEEN query like this: