Ciao a tutti.
Sto adattando una funzione php per l'autenticazione di utenti con nuova connessione Mysqli e PHP 7.
Ho dei problemi con questa query:
codice:
$query = "SELECT * FROM ".$_CONFIG['table_utenti']." WHERE username='".$uname."' and password=MD5('".$passw."') and temp = '0'";
$result = @mysqli_query($conn, $query);
if (mysqli_num_rows($result) != '1'){
return array(AUTH_INVALID_PARAMS, NULL);
} else {
$data = mysqli_fetch_array($result, MYSQLI_ASSOC);
return array(AUTH_LOGEDD_IN, $data);
}
Restituisce questo errore:
codice:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in .....
on line 93
La riga 93 e':
codice:
if(mysqli_num_rows($result) != '1'){
Ovviamente non mi autentica correttamente l'utente.
Ma dove sbaglio ?