php - MYSQLI_NUM_ROWS THROWS SERVER ERROR -
Can someone please explain to me that when I use the mysqli_num_rows () function, why do I keep the following error?
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator for notifying that time. That error has occurred and whatever may be the reason for the error could have been you.
More information about this error may be available in the server error log.
This is my PHP script:
& lt ;? Php // store user input variable $ username = $ _POST ['username']; $ Password = $ _POST ['password']; // user chooses from the table $ sql = "SELECT * members from WHERE user name = '$ user name' and password = '$ password'"; $ Result = mysqli_query ($ con, $ sql); $ count = mysqli_num_rows ($ result); / * // session starts and sets a cookie if the count is correct ($ count> = 1) {session_start (); $ _SESSION ['username'] = ''; $ _SESSION ['password'] = ''; Header ("location: index.html"); } // sends the message if the user does not match the input database {echo "invalid user name or password"; } * /? & Gt; Before it works fine I get mysqli_num_rows () function in this error I am using Plesk on a Godaddy server.
- You will need to learn how to read php and mysquila errors
- You need to learn how to properly use mysqli
- Do not pay any attention to this function
First
and others - Just get your data and use it as the flag for the last
Comments
Post a Comment