modification et enregistrement dans la base
Bonjour
J’ai un formulaire afficher de dans des valeurs de ma base je veux que quand je modifie ses valeur les modifications soit enregistré dans la base
Vraiment je suis bloqué et je ne sais pas par ou commencer
Voila le code de mon formulaire
Code:
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
| <html>
<head>
<title>modification de données</title>
</head>
<body>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$conn = mysql_connect($dbhost,$dbuser,$dbpass)or die('error connecting to mysql');
$dbname = 'asta';
mysql_select_db($dbname);
//$id_devis=$_POST["id_devis"];
$jour=$_POST["jour"];
$mois=$_POST["mois"];
$annee=$_POST["annee"];
$description_devis=$_POST["description_devis"];
$montant=$_POST["montant"];
$remise=$_POST["remise"];
$var=$_GET['var'];
// print $_GET['var'];
?><br><br><?php
$date=$annee."-".$mois."-".$jour;
$query="select * from devis where id_devis='$var'";
//echo $query;
$result = mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_array($result)){
?>
<form methode="post" action="modification1.php" name="deposer" >
<table width="366" border="0" align="center">
<input type="hidden" name="id_devis" value="<?php print("$row[id_devis]");?>">
<tr bgcolor="#969696">
<td width="134" align="right">
Date
</td>
<td width="222">
<input name="date" type="text" maxlength="20" value="<?php
print("$row[date]");
?>">
</td>
</tr>
<tr bgcolor="#969696">
<td width="700" align="right">
Description Devis
</td>
<td width="500">
<input name="date" type="text" maxlength="20" value="<?php
print("$row[description_devis]");
?>">
</td>
</tr>
<tr bgcolor="#969696">
<td width="700" align="right">
Montant
</td>
<td width="500">
<input name="date" type="text" maxlength="20" value="<?php
print("$row[montant]");
?>">
</td>
</tr>
<tr bgcolor="#969696">
<td width="134" align="right">
Remise
</td>
<td width="222">
<input name="remise" type="text" maxlength="20" value=
"<?php
print("$row[remise]");
?>">
</td>
</tr>
</table><br>
<center><INPUT TYPE="SUBMIT" VALUE="Modifier" >
<input type="reset" value= "Annuler" ></center></p>
</form>
<?php
}
?>
</body>
</html> |
svp aidez moi sur le code de l'enregistrement des modification