user1594645
user1594645

Reputation: 1

fatal error sqlsvr_fetch_array(). Cannot fetch array from query

This is driving me crazy and I can't seem to find any solutions online. I'm trying to use the sqlsvr_fetch_array() function and keep getting a fatal error. It says: "Fatal error: Call to undefined function sqlsvr_fetch_array() in C:\inetpub\wwwroot\confirmation.php on line 39"

This is my code:

$connectionInfo = array(
"UID" => 'sa',
"PWD" => '*******',
"Database" => "****"
);

/* Connect using SQL Server Authentication. */
$conn = sqlsrv_connect('10.206.244.103', $connectionInfo);
if ($conn === false) {
echo "Unable to connect.</br>";
die(print_r(sqlsrv_errors(), true));
} else {

echo 'CONNECTED';    
}
$params = array();
$options =  array( "Scrollable" => SQLSRV_CURSOR_KEYSET ); 
$sql1 ="SELECT * FROM temp_survey_table WHERE Confirm_Code = 'e32c7cdaf237322234f5ac3e768fbaa9'";
$result1 = sqlsrv_query($conn,$sql1, $params, $options);

$rows=sqlsvr_fetch_array($result8);
$invoice=$rows['Invoice_Number'];
$email=$rows['Email'];
$servicerate=$rows['Service_Rate']; 
$foodrate=$rows['Food_Rate'];
$comments=$rows['Comments'];

echo $invoice;
echo $email;
echo $servicerate;

Any help will be greatly appreciated. Thanks in advanced.

Upvotes: 0

Views: 153

Answers (1)

Jon
Jon

Reputation: 437474

Typo: it's sqlsrv_, not sqlsvr_.

            ^ RV        ^ VR

Quite difficult for a human to distinguish indeed.

Upvotes: 1

Related Questions