A list of php error [closed]

Error #2 and #3:

You have written a bit nonsense to the if() statement, mixed parts of what you intended to do.

replace these two lines

if(mysqli_num_rows((int)$sql_login>0)){
    $result = mysqli_fetch_array($sql_login);

with this one line

if( $result = mysqli_fetch_array($sql_login) ){

Description of said one line code: If there is a record, $result will become an array, which is always equivalent to ‘true’, if not, it will be set to ‘false’ value. Then, this $result is passed to if() evaluation. No need to check for number of rows. There either will be at least one and script will continue, or not.

Error #1 and #4:

The other thing is PHP says there is no ‘Email’ value in POST data. Check your login form if it contains this field, is well formed and how exactly it is named. I think you meant ‘username’ instead

Error #5:

These last few rows, althrough they are just in the body of if(/login correct?/) I believe that one query is part of unfinished code about activation process and that error message at the end should be moved out of this if(), to else{} body, as it informs about unsuccessful login.

Leave a Comment