1 2 3 4 5 6 7 8 9 10 11 12
|
function insertUser($pasword, $firstname, $lastname, $email, $tel, $type, $administration, $service, $autorisation, $level_struc, $user_parent) {
global $db;
$sql = 'INSERT INTO users
(pasword, firstname, lastname, email, tel, type, administration, service, autorisation, level_struc, user_parent, date_inscription)
VALUES (:pasword, :firstname, :lastname, :email, :tel, :type, :administration, :service, :autorisation, :level_struc, :user_parent, NOW())';
$statement = $db->prepare($sql);
if($statement->execute(array(':pasword'=>$pasword, ':firstname'=>$firstname, ':lastname'=>$lastname, ':email'=>$email, ':tel'=>$tel, ':type'=>$type, ':administration'=>$administration, ':service'=>$service, ':autorisation'=>$autorisation, ':level_struc'=>$level_struc, ':user_parent'=>$user_parent))){
return $db->lastInsertId();
}
else return $db->errorInfo();
} |
Partager