Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function add_user($nom,$prenom,$email){
- $stmt = $GLOBALS['bdd']->prepare("SELECT email FROM users WHERE email=:email");
- $stmt->execute(array(':email'=>$email));
- if($stmt->rowCount() == 0){
- $rsp = $GLOBALS['bdd']->prepare("INSERT INTO users(nom,prenom,email) VALUES(:nom,:prenom,:email)");
- $rsp->execute(array(
- ':nom' => $nom,
- ':prenom' => $prenom,
- ':email' => $email
- ));
- return true;
- }else{
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement