Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\registration\registration.php on line 66
i already tried mysqli_error() and does not fix this problem
<html>
<head>
<title>Registration Form</title>
</head>
<body>
<form method='post' action='registration.php'>
<table width='400' border='5' align='center'>
<tr>
<td><h1>Registration Form</h1></td>
</tr>
<tr>
<td>User Name:</td>
<td><input type='text' name='name'/></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='pass'/></td>
</tr>
<tr>
<td>Email:</td>
<td><input type='text' name='email'/></td>
</tr>
<tr>
<td><input type='submit' name='submit' value='Sign Up'/></td>
</tr>
</table>
</form>
</body>
</html>
<?php
mysql_connect("localhost","root","");
mysql_select_db("user_db");
if(isset($_POST['submit'])){
$user_name = $_POST['name'];
$user_pass = $_POST['pass'];
$user_email = $_POST['email'];
if($user_name==''){
echo "<script>alert('Please enter your Username')</script>";
exit();
}
if($user_pass==''){
echo "<script>alert('Please enter your password')</script>";
exit();
}
if($user_email==''){
echo "<script>alert('Please enter your email')</script>";
exit();
}
$check_email="select *select* from users where
user_email='$user_email'";
$run = mysql_query($check_email);
if(mysql_num_rows($run)>0){
echo"<script>alert('Email $user_email
is already exist in our databse, please try another
one')</script>";
exit();
}
$query = "insert into users
(user_name,user_pass,user_email) values('
$user_name','$user_pass','$user_email')";
if(mysql_query($query)){
echo "<script>alert('Registration
Successfull!')</script>";
}
}
?>