I have the very basic code for registration a new user.
if ($email != "" and $password != "") {
$statement = $pdo->prepare("INSERT INTO Users (email, password) VALUES (?, ?)");
$statement->execute(array($email, $password));
echo "<br>";
if try to register the same email a second time, I get the following Error Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
My question is, how can I hide this message from the user and instead display a generic Error message like "user is taken"
With best regards