mysql_num_rows() expects parameter 1 to be resource, boolean given in… on line 15
Hello, I have this error appear on my Website whenever I try to create an account, this is the code:
[php]if(isset($_POST[“usernamecheck”])){
include_once(“php_includes/db_conx.php”);
$username = preg_replace(’#[^a-z0-9]#i’, ‘’, $_POST[‘usernamecheck’]);
$sql = ‘SELECT id FROM users WHERE username="$username" LIMIT 1’;
$query = mysql_query($sql, $db_conx);
$uname_check = mysql_num_rows($query); //This is line 15[/php]
Can someone please explain what is going wrong here, I have looked around everywhere, but noone has the same problem in the same format.