我有一个选择选项可以使用 while 循环从表中获取数据
$select_material_code = "SELECT material FROM tbl_material";
$get_material_code = mysqli_query ($con, $select_material_code);
$options_material_Code = "--Select material Code--";
while ($result_material_code = mysqli_fetch_array($get_material_code))
{
$options_material_Code = $options_material_Code."<option>$result_material_code[0]</option>";
}
所有数据都按预期进入列表,因此,我想继续从选择选项中选择数据并将值提取到下一个文本框中,但我无法获取它。 请帮忙....
最佳答案
$select_material_code = "SELECT material FROM tbl_material";
$get_material_code = mysqli_query ($con, $select_material_code);
$options_material_Code = "--Select material Code--";
while ($result_material_code = mysqli_fetch_array($get_material_code))
{
$options_material_Code =
$result_material_Code."<option>$result_material_code[0]</option>";
}
关于php - 从 while 循环中从表中选择单个值到字段中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37716939/