再次嗨堆栈溢出, 我想显示 MySQL 数据库中的值并以相同的形式显示它,这可能吗?
我有这样的 html 表单:
<td>Barcode/td> <<-- select from database by barcode input text and show result to input text dname, three, four, five
<td><input type='text' id="barkode" name='barkode'/></td>
<td>Name</td>
<td><input type='text' id="dname" name='dname'/></td>
<td>three</td>
<td><input type='text' id="three" name='three' /></td>
<td>four</td>
<td><input type='text' id="four" name='four'/></td>
<td>five</td>
<td><input type='text' id="five" name='five' /></td>
任何引用任何评论都会有所帮助,谢谢
最佳答案
1.) 对您需要的数据进行选择查询。
2.)然后回显输入字段的 value 属性中的值
例如。
$res = $con->query('Select * from barcode where `id`=1');
$row = $res->fetch_assoc();
<input type='text' id="barkode" name='barkode' value='<?php echo $row['barcode']?>'>
关于php - 从数据库中选择 MySQL 在输入文本 html 中显示值 从另一个输入文本 html 中按值选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54827127/