I'm almost there, I have two tables, one stores unverified users, the other stores all users and has a column labeled "Verified" which is either a 1 or 0.
The code is able to check the hash sent in the email link and is able to get as far as deleting the user from the "unverified" table.
The code does not change "Verified" from 0 to 1 on the "users" table.
$SQL_REQUEST = "SELECT * FROM `unverified` WHERE `Hash`='$Hash'";
$SQL_RESULT = mysqli_query($DB_CON, $SQL_REQUEST);
$SQL_VALID = mysqli_num_rows($SQL_RESULT);
if($SQL_VALID > 0){
mysqli_query($DB_CON,"UPDATE users SET Verified=1 WHERE Username='$USERNAME'");
mysqli_query($DB_CON,"DELETE FROM `unverified` WHERE `Hash`='$Hash'");
echo '<p>Your account has been activated, you can now login <a href="https://www.site.org/login/">here</a></p>';
mysqli_close($DB_CON);
exit();
}
else{
die("The hash and/or username you provided was incorrect. If you believe this is an error, please contact customer support.");
}
Any help would be greatly appreciated.