I'm working with prepare on statement but i get this error:
Call to a member function bind_param() on boolean
public function getUtenteInfo($conn,$email,$password){
$sql = "SELECT utenti.cognome "
. "FROM utenti"
. "INNER JOIN agenzia "
. "ON agenzia.ID_AGENZIA = utenti.FK_AGENZIA "
. "INNER JOIN agenti "
. "ON agenti.ID_AGENTE = utenti.FK_Agente "
. "where (utenti.EMAIL = ? )";
echo $sql;
$stmt = mysqli_prepare($conn, $sql);
$stmt->bind_param('ss',$email,$password);
$stmt->execute();
$risultato = $stmt->get_result(); //esecuzione della query