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
| for ($travaux_ii=1; $travaux_ii<=$_POST['num_parcelle']; $travaux_ii++) {
for ($travaux_iii=1; $travaux_iii<=$_POST['num_produit']; $travaux_iii++) {
$travaux_i++;
$updateSQL = sprintf("UPDATE travaux SET fiche_culture_id=%s, parcelle_id=%s, `date`=%s, travaux=%s, operateur_id=%s, produit_id=%s, principe_actif=%s, total=%s, dose_ha=%s, N_consigne=%s, numero_fiche=%s, observations=%s, N=%s, P=%s, K=%s, date_recolte=%s, last_update=%s WHERE id_travaux=%s",
GetSQLValueString($_POST['fiche_culture_id_'.$travaux_ii.''], "int"),
GetSQLValueString($_POST['parcelle_id_1'.$travaux_iii.''], "int"),
GetSQLValueString($_POST['date_application'], "date"),
GetSQLValueString($_POST['justification'], "text"),
GetSQLValueString($_POST['operateur_id'], "int"),
GetSQLValueString($_POST['produit_id_1'.$travaux_iii.''], "int"),
GetSQLValueString($_POST['principe_actif_t_1'.$travaux_iii.''], "text"),
GetSQLValueString($_POST['Q_tt_1'.$travaux_iii.''], "double"),
GetSQLValueString($_POST['dose_ha_1'.$travaux_iii.''], "double"),
GetSQLValueString($_POST['traitement_phyto_id'], "text"),
GetSQLValueString($_POST['numero_fiche'], "text"),
GetSQLValueString($_POST['commentaire'], "text"),
GetSQLValueString($_POST['N'], "double"),
GetSQLValueString($_POST['P'], "double"),
GetSQLValueString($_POST['K'], "double"),
GetSQLValueString($_POST['date_recolte_1'.$travaux_iii.''], "date"),
GetSQLValueString($_POST['last_update'], "date"),
GetSQLValueString($_POST['id_travaux_2'.$travaux_i.''], "int"));
mysql_select_db($database_cultureV3, $cultureV3);
$Result1 = mysql_query($updateSQL, $cultureV3) or die(mysql_error());
}
} |
Partager