Hey guys I'm working on a login/register for and I'm struggeling with the following things. When registering there's a message (registration complete) but there's also an error I can't get rid off.
Als when the username is already taken there should be a message that says that but there isn't. The error I get is the following.
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool
given in C:\xampp\htdocs\testegistration.php on line 16
The code I use in registration.php is
<?php
session_start();
$con = mysqli_connect('127.0.0.1','jstam','12345');
mysqli_select_db($con, 'userregistration');
$name = $_POST['user'];
$pass = $_POST['password'];
$s = "select * from usertable where name = 'name' && passoword = '$pass'";
$result = mysqli_query($con, $s);
$num = mysqli_num_rows($result);
if($num == 1){
echo"Gebruikersnaam in gebruik";
}else{
$reg= "insert into usertable (name , password) values ('$name' , '$pass')";
mysqli_query($con, $reg);
echo"Registratie succevol";
}
?>