I am using sqlsrv_connect in my connection php file. My connection is successful but will not allow me to use the query() function to start pulling data
My Connection file:
<?php
$serverName = "...";
$uid = "...";
$pwd = "";
$databaseName = "...";
try {
$connectionInfo = array( "UID"=>$uid,
"PWD"=>$pwd,
"Database"=>$databaseName);
/* Connect using SQL Server Authentication. */
$connectionInfo = sqlsrv_connect( $serverName, $connectionInfo);
echo "Connected successfully";
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
?>
My Query:
<?php
include_once 'includes/dataconn2.inc.php';
$sql = "SELECT C_CODE, C_ID, C_DESCRIPTION FROM t_product";
$result = $connectionInfo->query($sql);
?>
I've tried inputting the query directly, but it makes no difference.