This script is not updating the database any clue why?
<?php
require "./connect.php";
include "./templates/header.inc";
echo "<table border=1 bordercolor=\"#000000\" cellpadding=6 bgcolor=\"#ffffff\">";
////////// If submit update record by id //////////
if ($submit) {
$sql = "UPDATE matrix_new_2 SET beacon_min='$beacon_min', beacon_max='$beacon_max', 60='$sixty', 66='$sixty_six', 72='$seventy_two' WHERE id = $id";
$result = mysql_query($sql);
echo "UPDATED";
echo $sql;
////////// If NO submit select all rows and display in a form ////////
} else {
echo "<tr><td colspan=6><center><h4>MODEL YEARS 2004 - 2002</h4></center></td></tr>";
$sql = "SELECT * FROM matrix_new_2";
$result = mysql_query($sql);
while($myrow = mysql_fetch_array($result)) {
$id = $myrow["id"];
$beacon_min = $myrow["beacon_min"];
$beacon_max = $myrow["beacon_max"];
$sixty = $myrow["60"];
$sixty_six = $myrow["66"];
$seventy_two = $myrow["72"];
//////// Form generated per database row //////////////
echo "<tr>\n<td><form method=\"post\" action=\"ratematrix.php?&id=$id\"></td>\n</tr>\n<tr>\n<td>$id</td>\n<td><input type=\"Text\" name=\"beacon_min\" size=\"10\" value=\"$beacon_min\"></td>\n<td><input type=\"Text\" name=\"beacon_max\" size=\"4\" value=\"$beacon_max\"></td>\n<td><input type=\"Text\" name=\"sixty\" size=\"4\" value=\"$sixty\"></td>\n<td><input type=\"Text\" name=\"sixty_six\" size=\"4\" value=\"$sixty_six\"></td>\n<td><input type=\"Text\" name=\"seventy_two\" size=\"4\" value=\"$seventy_two\"></td>\n<td><input type=\"Submit\" name=\"submit\" value=\"Submit\"></td>\n</tr>\n</form>\n\n";
}
}
echo "</table>";
include "./templates/footer.inc";
?>
When I echo the $sql I get this:
UPDATE matrix_new_2 SET beacon_min='300', beacon_max='600', 60='18.00', 66='18.00', 72='18.00' WHERE id = 1
which is exactly what I am trying to do.
any help appreciated.