I made a site using PHP, on my development server. But on the live server, I have problems getting a database connection.
Error:
Connection could not be established.
Array ( [0] => Array ( [0] => IM002
[sqlSTATE] => IM002 [1] => 0
=> 0 [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ) )
I have set up ODBC, and testet the connection sucessfully!
My ODBC is configured like this:
Microsoft SQL Server ODBC Driver Version 03.86.3959
Data Source Name: Zeus
Data Source Description:
Server: Zeus
Database: (Default)
Language: (Default)
Translate Character Data: Yes
Log Long Running Queries: No
Log Driver Statistics: No
Use Integrated Security: No
Use Regional Settings: No
Prepared Statements Option: Drop temporary procedures on disconnect
Use Failover Server: No
Use ANSI Quoted Identifiers: Yes
Use ANSI Null, Paddings and Warnings: Yes
Data Encryption: No
I'm using this PHP code:
<?php
function DB_Conn_Zeus ($dbname, $tsql)
{
$serverName = "10.0.0.10\Zeus,1001";
$uid = "xxx";
$pwd = "xxxxxx";
$connectionInfo = array("UID" => $uid, "PWD" => $pwd, "Database"=>$dbname);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn )
{
//echo "Connection established.<br />";
}
......
Can anyone see where the problem is?
I can ping the MSSQL server, and classic ASP seems to work just fine.