简体   繁体   中英

How to connect to MS SQL Server 2016 from PHP 7

I'm attempting to insert rows in table in a database hosted in MS SQL Server 2016 installed in my local computer. Here is my snippet $dbc = mssql_connect('MwangiCJ-PC/mwangi','sqluser','xxxx','mydb');

I have tried out the answer from mssql_connect() with PHP5 and MSSQL2012 Express but I still get the error Fatal error: Uncaught Error: Call to undefined function mssql_connect()

When i run a simple phpinfo() I can see that I already have both sqlsrv and pdo_sqlsrv available.

Am I missing anything else? Please help. Thank you.

From the PHP docs :

Warning
This function was REMOVED in PHP 7.0.0.
Alternatives to this function include:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM