dean012 Posted August 15, 2013 Share Posted August 15, 2013 error on line 66 <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><?phpmysql_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>"; } } ?> Quote Link to comment Share on other sites More sharing options...
gristoi Posted August 15, 2013 Share Posted August 15, 2013 correct Quote Link to comment Share on other sites More sharing options...
dean012 Posted August 15, 2013 Author Share Posted August 15, 2013 What do you mean correct? I got error on line 66 abt the parameter Quote Link to comment Share on other sites More sharing options...
gristoi Posted August 15, 2013 Share Posted August 15, 2013 i mean, correct - you do have an error there. If you would like someone to comment on how to fix it then please make sure you put a bit more information in your post as to what the problem is and what you have done to solve the issue so far. To start you off, ensure $user_email is not returning something that is causing the string to escape Quote Link to comment Share on other sites More sharing options...
dean012 Posted August 16, 2013 Author Share Posted August 16, 2013 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\registration\registration.php on line 66 Quote Link to comment Share on other sites More sharing options...
jcbones Posted August 16, 2013 Share Posted August 16, 2013 If the parameter is NOT a resource, and you are passing it the result of a query, then the query must be returning false, which is boolean. A query returning false means it failed. The first recourse of action for this would be to return the query error using mysql_error. This would tell you that you have a malformed query string, which would lead you to looking up the proper http://dev.mysql.com/doc/refman/5.0/en/select.html'>SELECT syntax for a MySQL query string. You should be using mysqli_error because you should be using mysqli or PDO at this point. Quote Link to comment Share on other sites More sharing options...
dean012 Posted August 16, 2013 Author Share Posted August 16, 2013 I see.. Thank you very much. I will try it out Quote Link to comment Share on other sites More sharing options...
aubenefit Posted August 16, 2013 Share Posted August 16, 2013 double SELECT in query Quote Link to comment Share on other sites More sharing options...
dean012 Posted August 16, 2013 Author Share Posted August 16, 2013 Warning: mysqli_query() expects at least 2 parameters, 1 given in G:\xampp\htdocs\Registration\registration.php on line 64Warning: mysql_num_rows() expects parameter 1 to be resource, null given in G:\xampp\htdocs\Registration\registration.php on line 66 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.