I am moving my site and database to a new server. The configuration is nearly the same except the new server is 64bit. I can connect to the database remotely with the username and password that I have in my php code to connect. Here is my database connect code:

<?php
$serverName = 'Nick_C_Desktop\SQLEXPRESS';
$connectionInfo = array('Database'=>'CSLogs', 'UID'=>'cslogslogin', 'PWD'=>'123456');
$connection = sqlsrv_connect($serverName, $connectionInfo);
?>

This code worked perfectly fine on my old server, but gives me this error:

Fatal error: Call to undefined function sqlsrv_connect() in C:\wamp\www\cslogs\includes\db_connect.php on line 4

I have these two items in my php.ini file enabled:

extension=php_pdo_sqlsrv_53_ts.dll
extension=php_sqlsrv_53_ts.dll

Which is what I had before. Using Wamp Server. PHP 5.3.13 all the same as before. What else am I missing that is not allowing this to connect to the SQL server. Thanks in advance!

    I figured it out. Stupid 64 bit version on Wamp Server. Uninstalled and installed 32 bit and works fine.

      2 months later
      Write a Reply...