1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <? session_start();
include("connect.php");
$n_art=$_SESSION['n_art'];
for($i=0;$i++;$i<6){
//concaténation de la date
//requete insertion premier tableau
$requete1="insert into etapes_travaux(desc_nat_trav,dd_trav,hd_trav,df_trav,hf_trav) values(coupe,$dd_trav$i,'".$_POST['hd_trav$i']."','".$_POST['df_trav$i']."','".$_POST['hf_trav$i']."') where $dd_trav$i=CONCAT('".$_POST['day$i']."',/,'".$_POST['month$i']."',/,'".$_POST['year$i']."')";
echo("$requete1");
$result= mysql_query($requete1) or die(mysql_error());
$id_et_tr=mysql_insert_id();
$project="select from employe nom_emp,pre_emp,ncin";
$resproject=mysql_query($project) or die(mysql_error());
//recherche dans la table employe
while($contenu_tab_emp=mysql_fetch_assoc($resproject)){
$requete2="insert into executer(ncin,id_nat_trav,n_art) values({$contenu_tab_emp['ncin']},$id_et_tr,$n_art) where nom_emp_ass$i=concat({$contenu_tab_emp['nom_emp']},'',{$contenu_tab_emp['pre_emp']})";
$result2= mysql_query($requete2) or die(mysql_error());
}
}
mysql_close();
?> |
Partager