0

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.

1 Answer 1

1

Typo: it's sqlsrv_, not sqlsvr_.

            ^ RV        ^ VR

Quite difficult for a human to distinguish indeed.

Sign up to request clarification or add additional context in comments.

1 Comment

Ahhhhhhhhhhhhhh! That was it! Thanks dude. Don't worry, I slapped myself for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.