Hi,
Thanks for your respons. I changed my code, but I don't know how to make a query for updating the database.
This is the page with the form. It's OK, I guess.
<?php
include "connect.php";
$query = "SELECT * FROM `prijzen`";
$sql = mysql_query($query) or die ( mysql_error( ) );
echo"<form method=\"POST\" action=\"test3.php\">" ;
echo"<table cellspacing=\"3\" width=\"100%\" border=\"0\">";
while($record = mysql_fetch_object($sql)){
echo"<tr><td>".$record->omschrijving."</td><td>€ <input type=\"text\" class=\"formfields\" name=\"".$record->id."\" size=\"6\" value=\"".$record->prijs."\"></td></tr>";
}
echo"</table><p><input type=\"submit\" value=\"Verzenden\" name=\"B1\" class=\"formfields\"></form>";
?>
In another file there must be query for updating the database and the new values must be confirmed on the screen:
<?
while($record = mysql_fetch_object($sql)){
echo '<input type="text" name="prijs[]" size="6" value="'.$record->prijs.'">';
echo '<input type="hidden" name="id[]" value="'.$record->id.'">';
}
echo "<pre>";
print_r($_POST);
foreach ($_POST[prijs] as $key=>$value)
{
echo "$_POST[id][$key] - $value <br>";
}
?>
If is better to do it all in one file, please let me know.
Thanks for helping, I really do not know how to get further.