FooKelvin Posted October 8, 2015 Share Posted October 8, 2015 Hi, Is that possible to connect to microsoft sql server by using mysqli? Currently i connected by using sqlsrv. For example, $serverName = "servername.com"; //serverName\instanceName $connectionInfo = array("Database" => "DB1", "UID" => "user99", "PWD" => "12345"); $conn = sqlsrv_connect($serverName, $connectionInfo); i have try quite some time to use mysqli to connect. But I keep getting errors.. Thank You Quote Link to comment https://forums.phpfreaks.com/topic/298481-can-php-integrate-with-microsoft-sql-by-using-mysqli/ Share on other sites More sharing options...
Barand Posted October 8, 2015 Share Posted October 8, 2015 No. mysqli_ functions, like mysql_ , are for the MySql database server just as sqlsrv functions are for MS SQL Server. PDO, however, is database independent so you could use that. Quote Link to comment https://forums.phpfreaks.com/topic/298481-can-php-integrate-with-microsoft-sql-by-using-mysqli/#findComment-1522662 Share on other sites More sharing options...
FooKelvin Posted October 8, 2015 Author Share Posted October 8, 2015 Thanks Barand. PDO, a new thing for me. Thanks A lot! Quote Link to comment https://forums.phpfreaks.com/topic/298481-can-php-integrate-with-microsoft-sql-by-using-mysqli/#findComment-1522667 Share on other sites More sharing options...
Barand Posted October 8, 2015 Share Posted October 8, 2015 Why do you want to change from sqlsrv if you are still using SQLServer? Quote Link to comment https://forums.phpfreaks.com/topic/298481-can-php-integrate-with-microsoft-sql-by-using-mysqli/#findComment-1522668 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.