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:
Restituisce questo errore: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); }
La riga 93 e':codice:Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in ..... on line 93
codice:if(mysqli_num_rows($result) != '1'){
Ovviamente non mi autentica correttamente l'utente.
Ma dove sbaglio ?

Rispondi quotando

