This one has me stumped. I'm attempting to update some of the fields in a single row in a table and getting a syntax error.
//get the current values for forecasted sales
$get_cur=mysql_query("select * from salesForecastPinsDist where distid='$distid'");
if ($row=mysql_fetch_row($get_cur)) {
$curForecast=array_slice($row,1);//slices the distid from the row
}
//update current values with new forecast
for($i=0;$i<sizeof($pincount);$i++) {
$update=mysql_query("update salesForecastPinsDist set $curForecast[$i]='$pincount[$i]' where distid='$distid'");
}
1064: You have an error in your SQL syntax near '0='0' where distid='139'' at line 1
Not all fields are to be updated but mysql recognizes that and won't update if the new values are the same as the original values.
Thanks in advance!