php - How to connection wamp host to remote sql server
Get the solution ↓↓↓I already uploaded following files in php C:\wamp\bin\php\php5.5.12\ext
- php_pdo_sqlsrv_55_nts.dll
- php_pdo_sqlsrv_55_ts.dll
- php_sqlsrv_55_ts.dll
I also enable following things in php.ini
- extension_dir = "c:/wamp/bin/php/php5.5.12/ext/"
- [PHP_SQLSRV] extension=php_pdo_sqlsrv_55_ts.dll extension=php_sqlsrv_55_ts.dll
But still i m getting error :
Fatal error: Call to undefined function sqlsrv_connect()
This is the code in my connection file :
$serverName = "xxx.xxx.xxx.x"; //serverName\instanceName
$connectionInfo = array( "Database"=>"xxxxx", "UID"=>"xxx", "PWD"=>"xxx");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn )
{
echo "Connection established.<br />";
}
else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: foreach() argument must be of type array|object, null given
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.