<table>
<?php
`extract($_POST);`
`$objorderdetails = new Dairy_System();`
`$result=$objorderdetails->getCustomerName();`
foreach($result as $row)
{
$result1=$objorderdetails->getOrderDetails();
foreach ($result1 as $row1)
{
?>
<tr>
<td><?php echo($row['UserName']); ?></td>
<td><input type="number" name="Quantity" value="<?php echo($row1['Quantity']); ?>">
<?php
if($row['Quantity']==NULL && $row['Quantity']==""){
$row['Quantity']=0;
}
?>
</td>
</tr>
<?php
}
}
?>
</table>
答案 0 :(得分:0)
使用输入数组。例如,name="Quantity"
<table>
<?php
`extract($_POST);`
`$objorderdetails = new Dairy_System();`
`$result=$objorderdetails->getCustomerName();`
foreach($result as $row)
{
$result1=$objorderdetails->getOrderDetails();
foreach ($result1 as $row1)
{
?>
<tr>
<td><?php echo($row['UserName']); ?></td>
<td><input type="number" name="Quantity[]" value="<?php echo($row1['Quantity']); ?>">
<?php
if($row['Quantity']==NULL && $row['Quantity']==""){
$row['Quantity']=0;
}
?>
</td>
</tr>
<?php
}
}
?>
</table>