$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>
结果是没有显示任何选定的行。哪一行是错的?