以下是代码:
$sql = 'SELECT id,Customer_Name FROM bewar';
$retval = mysqli_query( $con,$sql );
if(! $retval ) {
die('Could not get data: ' . mysqli_error());
}
while($row = mysqli_fetch_assoc($retval)) {
$cname=$row["Customer_Name"];
echo "<table>
<form>
<tr>
<th>Date</th>
<th>Customer Name</th>
<th>Slip No.</th>
<th>Amount</th>
</tr>
<tr>
<td><input type='text' name='date' id='date'
value=".date("Y/M/d").' required></td>
<td><input id="name" type="text" name="name" value= '.$cname.'
required></td>
</tr>
</form>
</table>';
}
mysqli_close($con);
?>
以上代码仅显示数据库中的姓氏,但我希望所有名称都显示在文本框中