setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Check if the user exists $sqlGetUserList = $conn->prepare("SELECT username FROM " . $userTableName . " WHERE username=\"" . $_GET["username"] . "\""); // Execute SQL query $sqlGetUserList->execute(); // Get results from the USERS table $results = $sqlGetUserList->fetch(); // Check if user exists if (mb_strtolower($_GET["username"]) == mb_strtolower($results["username"])) { $userExists = true; } else { $userExists = false; } } catch (PDOException $e) { // failed connection echo "Connection failed: " . $e->getMessage(); } ?>
USER NO EXISTS
"; } ?>