I have a problem.
Everytime I try to update some records, I get the undefined index error.
Could you guys take a look and see if anything is wrong?
// artikel.php
<?php
while($row = mysqli_fetch_array($records)) {
echo "<tr><form action='updateartikel.php' method='post'>";
echo "<td><input type='text' name='productcode' value=".$row['Productcode'] . "></td>";
echo "<td><input type='text' name='product' value=".$row['Product']."></td>";
echo "<td><input type='text' name='type' value=".$row['Type']."></td>";
echo "<td><input type='text' name='fabriekcode' value=".$row['Fabriekcode']."></td>";
echo "<td><input type='text' name='inkoopprijs' value=".$row['Inkoopprijs']."></td>";
echo "<td><input type='text' name='verkoopprijs' value=".$row['Verkoopprijs']."></td>";
echo "<input type=hidden name=productcode value='".$row['Productcode']."'>";
echo "<td><input type='submit' name='wijzigen' value='wijzigen'>";
echo "</form></tr>";
}
?>
// updateartikel.php
$productcode = $_POST['productcode'];
$product = $_POST['product'];
$type = $_POST['type'];
$fabriekcode = $_POST['fabriekcode'];
$inkoopprijs = $_POST['inkoopprijs'];
$verkoopprijs = $_POST['verkoopprijs'];
$sql = "UPDATE artikel SET ('Product', 'Type', 'Fabriekcode', 'Inkoopprijs', 'Verkoopprijs', 'Productcode')
VALUES ('$product', '$type', '$fabriekcode', '$inkoopprijs', '$verkoopprijs', '$productcode')";
Thanks!