Salut,
mon Problème est que une fois j’exécute la requête PDO je trouve rien dans ma BD,sachant que mon formulaire regroupe 4 tables liés entre eux ,
Voila mon Code ,
form :
et merci ,
Modifié par megho (31 Jul 2017 - 22:04)
mon Problème est que une fois j’exécute la requête PDO je trouve rien dans ma BD,sachant que mon formulaire regroupe 4 tables liés entre eux ,
Voila mon Code ,
<?php
$sql1=('insert into programme values(NULL,:dad,:daf,:ttp,:nbj,:dcr,:pdf,:nvx,:dap)');
$r=$cnx->prepare($sql1);
$r->bindParam(':dad',$_POST['dad'],PDO::PARAM_STR);
$r->bindParam(':daf',$_POST['daf'],PDO::PARAM_STR);
$r->bindParam(':ttp',$_POST['ttp'],PDO::PARAM_STR);
$r->bindParam(':nbj',$_POST['nbj'],PDO::PARAM_INT);
$r->bindParam(':dcr',$_POST['dcr'],PDO::PARAM_STR);
$r->bindParam(':pdf',$_POST['pdf'],PDO::PARAM_STR);
$r->bindParam(':nvx',$_POST['nvx'],PDO::PARAM_INT);
$r->bindParam(':dap',$_POST['dap'],PDO::PARAM_STR);
$sql2=('insert into information values (NULL,:idp,:glitter_etoiles,:itineraire,:exigences,:hauteur,:equipe,:hebergement)');
$r=$cnx->prepare($sql2);
$r->bindParam(':idp',$_POST['idp'],PDO::PARAM_INT);
$r->bindParam(':glitter_etoiles',$_POST['glitter_etoiles'],PDO::PARAM_STR);
$r->bindParam(':itineraire',$_POST['itineraire'],PDO::PARAM_STR);
$r->bindParam(':exigences',$_POST['exigences'],PDO::PARAM_STR);
$r->bindParam(':hauteur',$_POST['hauteur'],PDO::PARAM_STR);
$r->bindParam(':equipe',$_POST['equipe'],PDO::PARAM_STR);
$r->bindParam(':hebergement',$_POST['hebergement'],PDO::PARAM_STR);
$sql3=("insert into service values(NULL,:idp,:services,:non_inclus,:services_demande)");
$r=$cnx->prepare($sql3);
$r->bindParam(':idp',$_POST['idp'],PDO::PARAM_INT);
$r->bindParam(':services',$_POST['services'],PDO::PARAM_STR);
$r->bindParam(':non_inclus',$_POST['non_inclus'],PDO::PARAM_STR);
$r->bindParam(':services_demande',$_POST['services_demande'],PDO::PARAM_STR);
$sql4=('insert into date_prix values(NULL,:idp,:mnt)');
$r=$cnx->prepare($sql4);
$r->bindParam(':idp',$_POST['idp'],PDO::PARAM_INT);
$r->bindParam(':mnt',$_POST['mnt'],PDO::PARAM_INT);
$r->execute();
print_r($cnx->errorInfo());
?>
form :
<form method="POST" action="">
<div class="row">
<div class="col-xs-12 col-sm-4">
<div class="widget-box">
<div class="widget-header">
<h4 class="widget-title">Programme</h4>
<div class="widget-toolbar">
<a href="#" data-action="collapse">
<i class="ace-icon fa fa-chevron-up"></i>
</a>
</div>
</div>
<div class="widget-body">
<div class="widget-main">
<div class="form-group">
<label class="control-label" > Désignation </label>
<div class="input-group" style="width: 100%;">
<input class="form-control" type="text" placeholder="Désignation" name="ttp" />
</div>
</div>
<hr />
<div class="form-group">
<label class="control-label no-padding-right" > Date debut</label>
<div class="input-group">
<input class="form-control date-picker form-control" name="dad" type="date" data-date-format="dd-mm-yyyy" />
<span class="input-group-addon">
<i class="fa fa-calendar bigger-110"></i>
</span>
</div>
</div>
<hr />
<div class="form-group">
<label class="control-label no-padding-right"> Date fin </label>
<div class="input-group">
<input class="form-control date-picker form-control" name="daf" type="date" data-date-format="dd-mm-yyyy" />
<span class="input-group-addon">
<i class="fa fa-calendar bigger-110"></i>
</span>
</div>
</div>
<hr>
<div class="form-group">
<label class="control-label" > Nombre Jours</label>
<div class="input-group" >
<input class="input-medium form-control input-medium" type="text" " placeholder=" Nombre-Jours" name="nbj" />
</div>
</div>
<hr>
<div class="form-group">
<label class="control-label " for="dcr"> Description </label>
<textarea class="form-control" name="dcr" placeholder="Default Text"></textarea>
</div>
<hr>
<div class="form-group">
<label class="control-label" >Niveau </label>
<select class="input-medium form-control" name="nvx">
<option value=""></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
</div>
</div>
</div>
</div><!-- /.span -->
<div class="col-xs-12 col-sm-4">
<div class="widget-box">
<div class="widget-header">
<h4 class="widget-title">Infos Visite</h4>
<span class="widget-toolbar">
<a href="#" data-action="collapse">
<i class="ace-icon fa fa-chevron-up"></i>
</a>
</span>
</div>
<div class="widget-body">
<div class="widget-main">
<div class="form-group">
<label class="control-label ">Glitter étoiles </label>
<textarea class="form-control" name="glitter_etoiles" placeholder="Default Text"></textarea>
</div>
<div class="form-group">
<label class="control-label "> itinéraire </label>
<textarea class="form-control" name="itineraire" placeholder="Default Text"></textarea>
</div>
<div class="form-group">
<label class="control-label "> exigences </label>
<textarea class="form-control" name="exigences" placeholder="Default Text"></textarea>
</div>
<div class="form-group">
<label class="control-label "> hauteur </label>
<textarea class="form-control" name="hauteur" placeholder="Default Text"></textarea>
</div>
<div class="form-group">
<label class="control-label "> équipe </label>
<textarea class="form-control" name="equipe" placeholder="Default Text"></textarea>
</div>
<div class="form-group">
<label class="control-label "> hébergement </label>
<textarea class="form-control" name="hebergement" placeholder="Default Text"></textarea>
</div>
</div>
</div>
</div>
</div><!-- /.span -->
<div class="col-xs-12 col-sm-4">
<div class="widget-box">
<div class="widget-header">
<h4 class="widget-title">Service</h4>
<span class="widget-toolbar">
<a href="#" data-action="collapse">
<i class="ace-icon fa fa-chevron-up"></i>
</a>
</span>
</div>
<div class="widget-body">
<div class="widget-main">
<div class="form-group">
<label class="control-label" > services</label>
<div class="input-group" style="width: 100%;">
<input class="form-control" type="text" placeholder="" name="services" />
</div>
</div>
<hr>
<div class="form-group">
<label class="control-label" > non inclus</label>
<div class="input-group" style="width: 100%;">
<input class="form-control" type="text" placeholder="" name="non_inclus" />
</div>
</div>
<hr>
<div class="form-group">
<label class="control-label" >Services sur demande</label>
<div class="input-group" style="width: 100%;">
<input class="form-control" type="text" placeholder="" name="services_demande" />
</div>
</div>
<hr>
<div class="form-group">
<label class="control-label" >Prix </label>
<div class="input-group" style="width: 100%;">
<input class="form-control" type="text" placeholder="" name="mnt" />
</div>
</div>
<hr>
<div class="form-group">
<label class="control-label">Date publication </label>
<div class="input-group" style="width: 100%;">
<input class="form-control" type="text" name="dap" />
</div>
</div>
<div class="form-group">
<label class="control-label">pdf</label>
<div class="input-group" style="width: 100%;">
<input class="form-control" type="text" name="pdf" />
</div>
</div>
</div>
</div>
</div>
</div><!-- /.span -->
</div><!-- /.row -->
<div class="row clearfix form-actions text-center">
<button class="btn btn-info " type="Submit" name="ok">
<i class="ace-icon fa fa-check bigger-110"></i>
Ajouter
</button>
</div>
</form>
et merci ,
Modifié par megho (31 Jul 2017 - 22:04)