Reputation: 59
OS: Windows 8.1
Web Server: WAMPSERVER 3.0.6
PHP Version: 5.6.25
Goal: To establish MYSQL Database connection using PHP
What has been done:
SQLSRV
Drivers (SQLSRV32.EXE
)php_pdo_sqlsrv_56_ts.dll
and php_sqlsrv_56_ts.dll
to the directory "C:\wamp64\bin\php\php5.6.25\ext"
extension_dir = "c:/wamp64/bin/php/php5.6.25/ext/"
Added the following lines to the dynamic extensions part in the php.ini
file:
extension=php_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_ts.dll
Restarted Web Server
But: phpinfo()
is not listed in sqlsrv()
Code:
$myServer = "(local)";
$myUser = "sa";
$myPass = "pass";
$myDB = "example_db";
$connectionInfo = array("Database"=>$myDB, "UID" => $myUser, "PWD" => $myPass);
$conn = sqlsrv_connect($myServer, $connectionInfo);
Error:
Fatal error: Call to undefined function sqlsrv_connect() in
C:\wamp64\www\optimum_p\common\dbconnect.php on line 6
Upvotes: 0
Views: 424