I'm trying to connect to SQL Server using PHP, I'm learning this language.
I have read that probably a ODBC connection is the best, I have created mine ODBC but I don't know how to use it from PHP, so far I'm trying this:
$server = 'MyServer\MyDB';
// Connect to MSSQL
$link = mssql_connect=($server, 'MyUser', '');
if (!$link) {
die('You cannot connect to MSSQL');
}
When running this I get this message:
OBJECT NOT FOUND, ERROR 404.
But ODBC test is fine.
The SQL Server is located in the same PC, so maybe I don't need to input the IP.
Is there anybody who can help?