hi
i was writing a code to connect to sql server database..the username,passwo rd,and database name are all ok but it can't connect i have enable mixed mode authentication in sql server...it just says connection failed
here is the code
i was writing a code to connect to sql server database..the username,passwo rd,and database name are all ok but it can't connect i have enable mixed mode authentication in sql server...it just says connection failed
here is the code
Code:
function db_connect(){
$servername ='mail';
$root ='fund_nouser';
$pass ='****';
$dbname='fundmaster';
$connectionInfo= array("UID"=>$root,
"PWD"=>$pass,
"Database"=>$dbname);
$cx = cx();
//connection string
if ($cx == 0){
$conn = sqlsrv_connect($servername,$connectionInfo);
}
if (!$conn)
{
exit("Connection Failed: " . $conn);
return 0;
}
else
{
/
return $conn;
}
}
Comment