Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createUser($username, $password, $firstname, $lastname, $genre, $email, $mobile, $birthdate)
- {
- global $conn;
- $stmt = $conn->prepare
- ("
- INSERT INTO utilizador (utilizador, palavrapasse, nomeproprio, sobrenome, genero, email, telefone, datanascimento, dataregisto)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
- RETURNING idutilizador
- ");
- $currentdate = date("Y-m-d");
- $stmt->execute(array($username, sha1($password), $firstname, $lastname, $genre, $email, $mobile, $birthdate, $currentdate));
- $idutilizador = $stmt->fetch(PDO::FETCH_ASSOC);
- $stmt = $conn->prepare
- ("
- INSERT INTO utilizadornormal
- VALUES (?)
- ");
- $stmt->execute(array($idutilizador));
- }
Advertisement
Add Comment
Please, Sign In to add comment