prepare("SELECT * FROM user WHERE username = ?"); $req->execute(array($username)); if ($req->fetch()) { ?>
Username already exist !
closeCursor(); $req = $bdd->prepare("INSERT INTO user VALUES (?, ?, ?)"); $req->execute(array($username, $word, $nb)); $_SESSION["p1905458"] = $username; header("Location: helloworld4.php"); } $req->closeCursor(); } catch (Exception $e) { databaseError($e); } elseif ($bdd INSTANCEOF Exception) databaseError($bdd); } ?>