1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <?php
class EventStorage
{
private $bd;
public function __construct($bd)
{
$this->bd = $bd;
}
public function create(User $user)
{
$req = $this->bd->prepare('INSERT INTO users (email, firstName, lastName, adress, diet, country, allergy, clothingSize, tel)
VALUES (:email, :firstName, :lastName, :adress, :diet, :country, :allergy, :clothingSize, :telNumber)');
$email = $user->getEmail();
echo "Email : ".$email;
$firstName = $user->getFirstName();
$lastName = $user->getLastName();
$adress = $user->getAdress();
$diet = $user->getDiet();
$country = $user->getCountry();
$allergy = $user->getAllergy();
$clothingSize = $user->getClothingSize();
$telNumber = $user->getTelNumber();
$req->bindValue(':email', $email);
$req->bindValue(':firstName', $firstName);
$req->bindValue(':lastName', $lastName);
$req->bindValue(':adress', $adress);
$req->bindValue(':diet', $diet);
$req->bindValue(':country', $country);
$req->bindValue(':allergy', $allergy);
$req->bindValue(':clothingSize', $clothingSize);
$req->bindValue(':telNumber', $telNumber);
$req->execute();
echo "Apres execution ";
}
?> |
Partager