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>"; } } ?> Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/ Share on other sites More sharing options...
gristoi Posted August 15, 2013 Share Posted August 15, 2013 correct Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445119 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 Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445121 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 Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445123 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 Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445274 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. Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445279 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 Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445298 Share on other sites More sharing options...
aubenefit Posted August 16, 2013 Share Posted August 16, 2013 double SELECT in query Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445314 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 Link to comment https://forums.phpfreaks.com/topic/281191-error-parameter/#findComment-1445325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.