I am trying to connect PHP with mssql and facing this error. I have downloaded the drivers and installed and configured my PHP.ini file as well. I am receiving connection established but its not working for mssql_query can any body please help me on this.
<?php
$serverName = "server details";
$connectionInfo = array("Database"=> "mydbname", "UID" => "id", "PWD" => "password");
$conn = sqlsrv_connect($serverName , $connectionInfo);
if($conn){
echo "connection established <br />";
}
else{
echo "connection could not established <br />";
die(print_r(sqlsrv_errors(),true));
}
$query = "SELECT * FROM AgeNames";
$result = mssql_query( $query );
for ($i = 0; $i < mssql_num_rows( $result ); ++$i)
{
$line = mssql_fetch_row($result);
print( "$line[0] - $line[1]\n");
}
I have added these fields in PHP ini PHP ini image
and this is what i am getting in phpinfo()