create a "select element"
时间:2006-05-31 来源:liyongquan
/* written by LiYongQuan */
/* fetch data from a table, this table must contain two columns, one is department's ID, and another is department's name */
");
while($row=mysql_fetch_array($result))
{if($specify==$row["DID"])
$sel="selected";
else $sel="";
$DID=$row["DID"];
$DName=$row["DName"];
echo("$DName");
}
if($all=="T")
{if($specify=="%")
$sel="selected";
else
$sel="";
echo("所有部门");
}
echo("");
mysql_close($con);
unset($result);
}
/* fetch data from a table, this table must contain two columns, one is department's ID, and another is department's name */
");
while($row=mysql_fetch_array($result))
{if($specify==$row["DID"])
$sel="selected";
else $sel="";
$DID=$row["DID"];
$DName=$row["DName"];
echo("$DName");
}
if($all=="T")
{if($specify=="%")
$sel="selected";
else
$sel="";
echo("所有部门");
}
echo("");
mysql_close($con);
unset($result);
}
相关阅读 更多 +