你好,我从表中创建了一个菜单。我向表员工添加了用户none,使其成为选项菜单中的默认值。问题是我不知道如何将none用户添加为选项菜单中的默认值。这里是我有:PHP和选定的选项菜单
$query = "SELECT UserName FROM employee where Classification_ClassificationID = '2'";
$result = queryMysql($query);
if (!queryMysql($query)) {
"Query fail: $query<br />" .
mysql_error() . "<br /><br />";
}
else
{
<select name = "UserName", "Name" size = "1">'; // or name="toinsert[]"
while ($row = mysql_fetch_array($result)) {
'<option value="' . htmlspecialchars($row['UserName']) . '" >'
. htmlspecialchars($row['UserName'])
. '</option>';
只需在打开选择后手动添加''。 – 2011-01-05 01:04:29
好的,我很抱歉。但是这个代码很丑陋。 – 2011-01-05 01:10:23