PHP connection to the SQL database. Recently, I was asked if I wanted to use PHP to connect to the sqlserver database during php development. I told them that mssql_connect ($ host, $ username, $ password) can be used for implementation. Recently, someone asked me if I was using PHP for development, I want to use php to connect to the SQL server database. I told them that mssql_connect ($ host, $ username, $ password) can be used to connect PHP to the SQL database.
In fact, you can find this function once you search the internet. many of them use it. However, my friend reported that the system does not define mssql_connect (), which is strange. I have always used it. I suspect that his PHP version is too low to support it, he told me php5.14. This version does not have a problem.
Where is the problem? I tried a variety of methods later and couldn't solve it.
Later, I suddenly remembered that PHP's functions were all configured by PHP. INI. will it fail to enable SQL server support? At first glance, no.
PHP connection to SQL database solution:
1. find php. ini in the directory of apache2 and open it.
2. find "; extension = php_mssql.dll", remove the previous ";", and save
3. restart the apache service (be sure to restart it. many of them often forget it, but do not know why)
You can use mssql_connect () to connect to SQL server to connect PHP to SQL database.
Recently, someone asked me if I wanted to use PHP to connect to the SQL server database during php development. I told them that mssql_connect ($ host, $ username, $ password) can be used for implementation...