limitphp Posted December 5, 2008 Share Posted December 5, 2008 I have a page that deals with users who forget their passwords. It starts by having them type in their username. Once they submit it, it checks if the username exists. If it does, it takes them to a form to verify their info and security question. This is where I have the error. It starts by getting the username: $username = check_input($_POST['username']); function check_input($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } $value = mysql_real_escape_string($value); return $value; } function does_username_exist($username) { $queryUsername = "SELECT username FROM user WHERE username = '$username'"; $result = mysql_query($queryUsername) or die (mysql_error()); return (boolean) mysql_num_rows($result); } if ($mode==1){ if (does_username_exist($username)==1){ $mode = 2; } } if ($mode==2){ $queryRegister = "SELECT username FROM user WHERE username = '$username'"; $result = mysql_query($queryRegister) or die (mysql_error()); [b]$rowCount=mysql_num_rows();[/b] } I'm getting the error at the bold line. Mode equals 1 when I submit the username. The username does exists, so, it will go to mode 2. Then I get the error: Wrong parameter count for mysql_num_rows() in C:\wamp\www\website\forgetPassword.php Link to comment https://forums.phpfreaks.com/topic/135659-solved-help-with-wrong-parameter-count-for-mysql_num_rows-error/ Share on other sites More sharing options...
gevans Posted December 5, 2008 Share Posted December 5, 2008 $rowCount=mysql_num_rows($result); Link to comment https://forums.phpfreaks.com/topic/135659-solved-help-with-wrong-parameter-count-for-mysql_num_rows-error/#findComment-706774 Share on other sites More sharing options...
limitphp Posted December 5, 2008 Author Share Posted December 5, 2008 Thanks. I had forgot that I had taken that out when I changed it. Link to comment https://forums.phpfreaks.com/topic/135659-solved-help-with-wrong-parameter-count-for-mysql_num_rows-error/#findComment-706856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.