Here is my code:
$token = $_GET['validate_activate']; // it's something like this "98j34f0j043f094f98325r"
$user_id = $_GET['user_id'];
// db connection here
$stmt = $dbh->prepare("DELETE FROM activate_token WHERE token = :token");
$stmt->execute(array(':token' => $token));
if ( /* deleting is success */ ) {
// activating the user
} else {
// your token is invalid
}
Well how can I make a correct condition for that if
statement?