INSERT INTO
Posté : 18 juin 2014, 14:33
Bonjour à tous,
Je souhait insérer des données dans ma bdd, mais seule une ligne vide s'insère, je pense que c'est un problème de concaténation, ou de syntaxe.
Cordialement.
Je souhait insérer des données dans ma bdd, mais seule une ligne vide s'insère, je pense que c'est un problème de concaténation, ou de syntaxe.
$libelle = $_POST['libelle'];
$ville = $_POST['ville'];
$departement = $_POST['departement'];
$client = $_POST['client'];
$chargedetude = $_POST['chargedetude'];
$chargedaffaire = $_POST['chargedaffaire'];
$type = $_POST['type'];
$dateoffre = $_POST['dateoffre'];
$fourniture = $_POST['fourniture'];
$soustraitance = $_POST['soustraitance'];
$etude = $_POST['etude'];
$chantier = $_POST['chantier'];
$mes = $_POST['mes'];
$notification = $_POST['notification'];
$debut = $_POST['debut'];
$fin = $_POST['fin'];
$mdb = $_POST['mdb'];
$levee = $_POST['levee'];
$format = "%d/%m/%Y";
$add_affaire = $bdd->prepare('INSERT INTO `affaire`(`Avancement_affaire`, `Libelle_affaire`, `Lieu_affaire`, `Dept_affaire`, `ID_charge_affaire`, `ID_charge_etude`, `Client`, `Type_etude`,`Date_offre`, `Achat_fourniture_p`,`Achat_soustraitance_p`, `MOE_etude_p`, `MOE_chantier_p`, `MOE_mes_p`, `Devis_mdb_p`,`Phase_notification_p`, `Phase_debut_p`, `Phase_fin_p`, `Reserves_p`)
VALUES ("1" , :libelle , :ville , :departement , :chargedaffaire , :chargedetude , :client , :type , :dateoffre, :fourniture , :soustraitance, :etude , :chantier , :mes , :mdb , str_to_date( :notification , :format), str_to_date(:debut, :format), str_to_date(:fin,:format), str_to_date(:levee,:format))');
print_r($ajout_affaire);
$ajout_affaire = $add_affaire->execute(array(
'libelle' => "$libelle",
'ville' => "$ville",
'departement' => "$departement",
'format' => "$format",
'client' => "$client",
'chargedaffaire' => "$chargedaffaire",
'chargedetude' => "$chargedetude",
'type' => "$type",
'dateoffre' => "$dateoffre",
'fourniture' => "$fourniture",
'soustraitance' => "$soustraitance",
'etude' => "$etude",
'chantier' => "$chantier",
'mes' => "$mes",
'notification' => "$notification",
'debut' => "$debut",
'fin' => "$fin",
'mdb' => "$mdb",
'levee' => "$levee"
));
Merci d'avance pour votre aide.Cordialement.