Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>PHP MYSQL</title>
- <meta charset = "utf-8">
- </head>
- <body>
- <?php
- $new_user = True;
- $mail = "sim.pierre91@gmail.com";
- $serveur = "localhost";
- $login = "root";
- $pass = "";
- try {
- $connexion = new PDO("mysql:host=$serveur;dbname=emirates stadium",$login,$pass);
- $connexion -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $requete = $connexion->prepare("SELECT user_email FROM users where user_email ='$mail'");
- $requete->execute();
- $res = $requete->fetchall();
- if(!empty($res)){
- $new_user = False;
- }
- if ($new_user) {
- echo "new user";
- }
- else {
- echo "not a new user";
- }
- } catch (PDOException $e) {
- echo "ECHEC " .$e->getMessage();
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement