at the top in the php code I am getting the data from the DB:
$pricesql="SELECT * FROM my_table";
$pricesqlresult=mysql_query($pricesql);
In the body I am having the following in order to list the results
<?php
while($rows=mysql_fetch_array($pricesqlresult)){
$date[]= $rows['date'];
?>
<p><input name="price[]" type="text" value="<? echo $rows['price']; ?>"></p>
<?php
}
?>
at the bottom of the page I have a php code with following sql:
<?php
if($_SERVER['REQUEST_METHOD'] == "POST"){
for($i=0;$i<$count;$i++){
$sql1="UPDATE my_table SET price='".$_POST['price'][$i]."' WHERE date='$date[$i]'";
$result99=mysql_query($sql1);
}
}
mysql_close();
?>
I do not know why the code does not update.
Thanks