This is my code:
$u_check = mysql_query("SELECT username FROM users WHERE usnername='$un' '");
$check = mysqli_num_rows ( $u_check );
I get the following error:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\Socially\index.php on line 27
I can't fix this, i am using a tutorial to help me do something, and this is what he typed. I really want to fix it so i can continue what I want to do; I'm doing the database because I am making a login and register form. Please help. When I type $check = mysqli_num_rows ( $u_check );
into the sql tab in phpmyadmin, i get this message:
Static analysis:
3 errors were found during analysis.
Unexpected character. (near "$" at position 0)
Unexpected character. (near "$" at position 25)
Unexpected beginning of statement. (near "$" at position 0)SQL query:
$check = mysqli_num_rows($u_check)MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
near '$check = mysqli_num_rows($u_check)' at line 1