Hi i'm having difficulty passing in a value containing an ó into a SQL statement.
The while loop will not run due to the statement not running. The statement runs fine with any other values passed in except this particular one.
Is there a way I can encode the statement so that it runs?
I cannot change the ó for a normal o as the value in the database contains an ó.
The code I have been trying is below.
Cheers
<?php
include 'connect.php';
$choicetest = 'óvil';
$query = "SELECT test FROM [testtable] WHERE test = '$choicetest' GROUP BY test";
$result = sqlsrv_query($conn, $query);
while ($line = sqlsrv_fetch_array($result)) {
$var = 'hello';
}
?>