gpt4 book ai didi

php - 无法填充组合框选项

转载 作者:行者123 更新时间:2023-11-30 01:35:31 25 4
gpt4 key购买 nike

$i = 1;
$tbl = "";
$field = "";

if($_POST['jenis']=="Bahan Baku")
{
$tbl = "bahanbaku";
$field = "bb_";
}
else if($_POST['jenis']=="Bahan Penunjang")
{
$tbl = "bahanpenunjang";
$field = "bp_";
}

<select class="span10" name="jenis" class="add-on">
<?php
$opt = "SELECT bb_nama FROM ".$tbl."";
$result = mysql_query($opt);
if($row = mysql_fetch_array($result))
{
echo "<option>". $row[$field.'nama'] ."</option>";
}
?>
</select>

结果是没有显示任何选定的行。哪一行是错误的?

最佳答案

while ($row = mysql_fetch_array($result))
{
echo "<option>". $row[$field.'nama'] ."</option>";
}

关于php - 无法填充组合框选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16947658/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com