1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
<?php
//Query
$affiche= "SELECT * FROM Details ORDER BY Category ASC";
//Execution Query
$res=mysql_query($affiche);
while($li=mysql_fetch_assoc($res)){
echo "<tr>
<td name='txtcategory'>".$li['Category']."</td>
<td name='txtvalue'><input class='norm' size='10' name='txtvalue' value=".$li['Value']."></td>
</tr>";
}
echo $_POST['txtcategory'];
//Update Query
$sql = "UPDATE `details` SET `Value` = '{$_POST['txtvalue']}'
WHERE `Transaction_ID` = 1 AND `Category` = '{$_POST['txtcategory']}' ";
echo $sql;
mysql_query($sql) or die(mysql_error());
echo (mysql_affected_rows()) ? "Modifications effectuees.<br />" : "Aucune modification n'a ete enregistree <br />";
?> |