I’m using this php code to update a table, but nothing is updating?
if(isset($Submit))
{
include('connect_mysql.php');
for($i=0;$i<$count;$i++)
{
$sql = "UPDATE $table SET cost='{$cost[$i]}', net=('{$bypiece[$i]}' + '{$cost[$i]}') WHERE serial='{$serial[$i]}'";
$result = mysql_query($dbcon, $sql);
}
}
if($result)
{
header("location:admin-index.php#office.php");
mysql_close();
}
It seems like it should work, and i have no reason why it wouldn’t.
My variables are defined, and when i echo them out with an else statement everything seems to be alright. Yet the data isn’t being updated, and the header isn’t redirecting.
Can anyone help me find a working solution?
A good idea when debugging is turn on error reporting.
Also see if you have any errors in your sql statement by changing
to