a classmate of mine ask me why is her syntax giving her an error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in line 103
here's her code: (i tried to help but it seems that we we're just in the same level :biggrin
i tried changing:
into
but no luck
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in line 103
here's her code: (i tried to help but it seems that we we're just in the same level :biggrin
PHP:
function check_user($user,$pass)
{
if ($this->is_checked($user) && $this->is_checked($user) )
{
$this->connect();
$query = "select emp_auth.user_id FROM emp_auth, emp_users WHERE emp_auth.user_id = emp_users.user_id AND emp_auth.passcode = " . $pass . " AND emp_users.user_name = \"" . $user . "\";";
$result = mysql_query($query);
$num = mysql_num_rows($result); //line 103
mysql_close();
if ($num == 1)
return mysql_result($result,0,"emp_auth.user_id");
else
return false;
}
}
i tried changing:
PHP:
if ($this->is_checked($user) && $this->is_checked($user) )
PHP:
if ($this->is_checked($user) && $this->is_checked($pass) )