Home > Article > Backend Development > php framework - How does thinkphp5 connect to SQL server2012?
1. I am using xampp on this machine, and the PHP framework is thinkphp5. Now because of the need, I need to develop on the sqlserver database. I want to develop an application using sqlserver through thinkphp.
2. The main question is the general direction of using the thinkphp5 framework to connect to the local sqlserver.
3. Thank you very much if you can explain it in detail. You can also tell me the process of each step, and I will Google the corresponding keywords myself, or you can recommend a complete reference document. Thank you in advance.
4. When connecting to sqlserver, there is no problem connecting directly through PHP, but connecting through tp5 will report a driver not found error. The screenshot is as follows
1. I am using xampp on this machine, and the PHP framework is thinkphp5. Now because of the need, I need to develop on the sqlserver database. I want to develop an application using sqlserver through thinkphp.
2. The main question is the general direction of using the thinkphp5 framework to connect to the local sqlserver.
3. Thank you very much if you can explain it in detail. You can also tell me the process of each step, and I will Google the corresponding keywords myself, or you can recommend a complete reference document. Thank you in advance.
4. When connecting to sqlserver, there is no problem connecting directly through PHP, but connecting through tp5 will report a driver not found error. The screenshot is as follows
TP5 has built-in driver support for sql server. Therefore, you only need to set the database type in the database configuration file database.php. Its usage is the same as using other database types:
For example:
<code>'type' => 'Sqlsrv' </code>