"“call to undefined function sqlsrv_connect()” when trying to connect to azure db from php" Answer’s

0

you have to use the SQL Server native driver for php at first place, then you can do something like:

$serverName = "tcp:sample.database.windows.net, 1433";

$connectionOptions = array("Database" => "sampleInit", 

                           "UID" => "sampleUsr@sample",

                           "PWD" => "samplePass",

                           "MultipleActiveResultSets" => false);

$conn = sqlsrv_connect($serverName, $connectionOptions);

if($conn === false)

{

     die(print_r(sqlsrv_errors(), true));

}

You can read more on PHP and SQL Azure at following blog post:
http://blogs.msdn.com/b/brian_swan/archive/2010/02/12/getting-started-with-php-and-sql-azure.aspx

Wednesday, March 31, 2021
 
MGP
answered 11 Months ago
MGP
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share