Non riesco a trovare la sintassi per fare una query prepared statment che usi la select/like
io ho scritto questo;
Codice PHP:
$query = "SELECT id, cognome, nome FROM utente " .
"WHERE nome like % ? %";
if ($stmt = $mysqli->prepare($query)) {
$stmt->bind_param("s", "fabio");
} echo $mysqli->error;
ma ho quest'errore:
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 '% ? %' at line 1
Codice PHP:
ho provato anche mettendo gli apici ma niente da fare
$query = "SELECT id, cognome, nome FROM paziente " .
"WHERE cognome like '% ? %'";