-3

I get an error ===> mysql_affected_rows() expects parameter 1 to be resource, boolean given in /var/www/mf/activate.php on line 23 when i execute the below code

$query_verify="UPDATE login SET status='active' WHERE username ='$username' AND actkey='$key'";  
      $result_verify=mysql_query($query_verify);
        if($result_verify)
          {
            $result= (mysql_affected_rows($result_verify)== ' 1 ');
            if($result)
    {
    echo "true";
   }
  else
   {
    echo "false";
   }

please help me to solve the problem query is executed but get this proble

  • 3
    Welcome to Stack Overflow! [Please, don't use `mysql_*` functions](http://stackoverflow.com/q/12859942/1190388) in new code. They are no longer maintained and are [officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). Learn about prepared statements instead, and use [tag:PDO] or [tag:MySQLi]. – hjpotter92 Jun 21 '14 at 13:08
  • 1
    `' 1 '` why the spaces? – Mark Baker Jun 21 '14 at 13:10

1 Answers1

1

Call mysql_affected_rows() without the parameter $result_verify.

Jimmy T.
  • 3,843
  • 2
  • 21
  • 37