是否可以在PHP中填充仅显示数据表的1列的下拉列表?
这是我的PHP文件。这是我从数据库中检索行的方法。我想要的只是在一个下拉列表中显示MySQL表的一列。
<?php // get all sanggunian
include_once($_SERVER['DOCUMENT_ROOT']."/eLTS/eLTS_lib/libSanggunianManagement.php");
$strMessage;
$mySanggunianManager = new SanggunianManager();
if($mySanggunianManager->getAllSanggunian($strMessage))
{
print "<table id='myTable' class='myTable' border=0 style='font-size:12px;'>";
print "<tr>";
foreach($mySanggunianManager->arrHeaders as $strHeader)
//print "<th bgcolor='#003f22'>".$strHeader."</th>";
print "<br>";
foreach($mySanggunianManager->arrObjects as $myRow)
{
print "<tr>";
//print "<select>";
foreach($myRow as $strHeader=>$strValue )
//print "<td id='td' align='center'>".$strValue."</td>";
print "<option>";
print $strValue;
print "</option>";
print "</tr>";
}
print "</table>";
}
?>