I have the problem to retrieve information from SQL server database. But no problem to insert data.
this is the simple code:
$serverName = "xx.xx.xx.xx\SQLEXPRESS,1433";
$connectionOptions = array(
"Database" => "Test",
"Uid" => "User",
"PWD" => "Password"
);
$connection = sqlsrv_connect($serverName, $connectionOptions);
if (!connection) {
die("Database connection failed: " . mssql_get_last_message() );
} else {
echo("Connected Successfully </br>" );
}
$sql = " INSERT INTO Imaging (ap) VALUES (1)";
$result = sqlsrv_query( $connection, $sql);
This code working perfectly.
But if I trying to retrieve data
$sql = "select ap from Imaging ";
$result = sqlsrv_query( $connection, $sql);
var_dump($result);
I have this result. Connected Successfully resource(2) of type (SQL Server Statement)
What is wrong?
Thank you