1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
//Insertion fiche
function insertFiche($user, $nom, $age, $email, $portable, $horaires, $presentation, $specialites, $canton, $ville, $logo) {
global $db;
$sql = 'INSERT INTO fiches
(user, nom, naissance, email, telephone, horaires, presentation, specialites, canton, ville, logo, date_enregistrement)
VALUES (:user, :nom, :age, :email, :portable, :horaires, :presentation, :specialites, :canton, :ville, :logo, NOW())';
$statement = $db->prepare($sql);
if ($statement->execute(array(':user'=>$user, ':nom'=>$nom, 'age'=>$age, ':portable'=>$portable, ':horaires'=>$horaires, ':presentation'=>$presentation, ':specialites'=>$specialites, ':canton'=>$canton, ':ville'=>$ville, ':logo'=>$logo))) {
return $db->lastInsertId();
}
}
//Exécution du code...
$idFiche = insertFiche($_SESSION['user'], $_POST['nom'], $_POST['age'], $_POST['email'], $_POST['portable'], $_POST['horaires'], $_POST['presentation'], $_POST['specialites'], $_POST['canton'], $_POST['ville'], $clean_name); |
Partager