Jump to content

[SOLVED] Help with Wrong parameter count for mysql_num_rows() error


limitphp

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.