I have a code which runs after somebody clicks on a "Delete Account" button and it should change "deleted" value from 0 to 1, but apparently my code isn't working. Can anybody help me finding the problem?
$dsn = 'mysql:host=127.0.0.1;dbname=user_db;charset=utf8';
$conn = new PDO($dsn, $username1, $password);
$conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "UPDATE users SET deleted = :1 WHERE username = :$username";
$stmt= $conn->prepare($sql);
$stmt->execute("1, $username");
header("location:logout.php");