$servername = "radiogaladmin.mysql.db"; $username = "radiogaladmin"; $password = "SamiQuentin1998"; $dbname = "radiogaladmin"; try { $db = new PDO("mysql:host=$servername;dbname=$dbname;charset=utf8mb4", $username, $password); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); } // ================================ check user if exist or not (for removed account). // $usrSessID = $_SESSION['id']; // $usrRemovedAcc = $conn->prepare("SELECT id FROM signup WHERE id=:usrSessID"); // $usrRemovedAcc->bindParam(':usrSessID',$usrSessID,PDO::PARAM_INT); // $usrRemovedAcc->execute(); // $$usrRemovedAccCount = $usrRemovedAcc->rowCount(); // if (isset($usrSessID)) { // if($$usrRemovedAccCount < 1){ // session_destroy(); // } // }