well the user will go to the url which will have a token in it...if token exists then it will unblock account.
now i want the user_id so i can send the user to the change password action...I'm passing the user_id as a parameter so if the $user_id parameter is not null in the change password action he/she can change password without logging in.
else if null and not authenticated then redirected to log in...if that sounds right
i couldnt think of another way of letting the user change password without being authenticated.
is it possible to get the value of user_id when updating a row?..this query works but im struggling to get the user_id (doesnt return a result)
UPDATE users
SET status = 'Active',
token = NULL
WHERE token = 'test'
AND status = 'Blocked'
AND (SELECT user_id as `user_id`)
if i'm not able to do it that way then i could use the following, but would be great if i was able to do this all in one query.
SELECT LAST_INSERT_ID();
thank you
use the code below of top of your script's while developing...let us know if you get an error of some kind.
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(E_ALL);
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.