Here is code I am trying out. I am getting an error message:
/* Specify the server and connection string attributes. */
$serverName = "XXXXXXX";
/* Get UID and PWD from application-specific files. */
$uid = "XXXXXX";
$pwd = "XXXXXXX";
$connectionInfo = array( "UID"=>$uid,
"PWD"=>$pwd,
"Database"=>"XXXXXXXXX");
/* Connect using SQL Server Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);//THIS IS LINE 24
if( $conn === false )
{
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));
}
$name = 'Hello';
$email = 'Goodbye';
$params = array($name, $email);
$sql = 'INSERT INTO Temp (Teams, Records) VALUES (?, ?)';
$stmt = sqlsrv_query($conn, $tsql, $params);
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
I am getting the following error:
Fatal error: Call to undefined function sqlsrv_connect() in C:\Web\MySite\test.php on line 24
I installed the sqlsrv files in php/ext and I added extension=php_sqlsrv.dll to php.ini and then I rebooted.
Any help appreciated!