我正在尝试使用foreach
循环更新多个记录,但是它将替换为先前的记录:
TableID ---- ProductID --- Color ---- ImageSample
foreach($Extras['ColorText'] as $key=>$val)
{
$query = "update productcolor set
Color = '".$Extras['ColorText'][$i]."' Where
ProductID = '".$RecordID."' ";
echo $query;
$App1->query($query);
$i++;
}
我的HTML代码:
<td align="left" valign="top">Product <br />
<input type='text' name='Color[]' class='auto TextField' value="<?php echo $App->f("Color"); ?>"></td>
</td>
显示查询:
update productcolor set Color = 'sdasdas', ImageSample = '' Where ProductID = '93' update productcolor set Color = 'sdasdas', ImageSample = '' Where ProductID = '93' update productcolor set Color = 'Yellow', ImageSample = 'listing.png' Where ProductID = '93'