this is how I have created search option does not appear on the page this thread and the fine I have to work but this is how I should look for 3 fields in the table, and it works in any way.
if($stmt = $this->mysqli->prepare('SELECT `navn`, `link`, `img`, `omrade` FROM `ordblindtest` WHERE `navn` LIKE "%" . $navn . "%" OR `omrade` LIKE "%" . $omrade . "%" OR `sogord` LIKE "%" . $sogord . "%"'))
{
$stmt->bind_param('sss', $navn, $omrade, $sogord);
$navn = $_POST["sogord"];
$omrade = $_POST["sogord"];
$sogord = $_POST["sogord"];
...
}
Problem is that I get this error:
Error on: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '. $navn . "%", OR
omrade
LIKE "%" . $omrade . "%", ORsogord
LIKE "%" . $sog' at line 1
I do not understand why it appears with the error. Why am I receiving the error?