prepare("UPDATE blog_members SET active = 'yes' WHERE memberID = :memberID AND active = :active"); $stmt->execute(array( ':memberID' => $memberID, ':active' => $active )); //if the row was updated redirect the user if($stmt->rowCount() == 1){ $stmt = $db->prepare("SELECT username FROM blog_members WHERE memberID = :memberID"); $stmt->execute(array( ':memberID' => $memberID, )); $row = $stmt->fetch(); $username = $row['username']; //redirect to login page write_log('Nouveau membre : '.$username, $db); header('Location: '.SITEURL.'/admin/login.php?action=active'); exit; } else { header('Location: '.SITEURL.'/admin/login.php?action=echec'); exit; } } ?>