This question already has an answer here:
i have created one reregistration system from which user can register there-self to use my system.
i have created one Verification process to avoid robot
Verification Process:-
i have created on column in database with 'active' name AS DEFINED '0' so what it does when the value is set to be '0' that means user has not activated his/her account so he can't login into my system. If value set to be '1' then account activated and he/she can use the system now.
To set the AS DEFINED value to 1 i have created on function through which i sending out an Email to user's entered email address while reregistration process with random email_code. once he hit that code in URL then AS DEFINED value will be Changed to 1.
Now i stuck with and error i have spend hours to figure out the solution for this
Error :
Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pratik\minimal\core\functions\users.php on line 123
Code :
function activate($email, $email_code) {
$email = mysql_real_escape_string($email);
$email_code = mysql_real_escape_string($email_code);
if(mysql_result(mysql_query("SELECT COUNT(`registration_id`) FROM `register` WHERE `email` = '$email' AND `email_code` = '$email_code' AND `active` = 0") or die(mysql_error()), 0) == 1) {
mysql_query("UPDATE `register` SET `active` = 1 WHERE `email` = '$email'");
return true;
} else {
return false;
}
}
Please help !!
</div>