$.post('fagetsid.php', //ajax 请求获得SID的页面
{'dt':$('#dat1').val()}, //传递数据
function(data){
var html="<tr><td class='linenumber'><input name='SID[]' type='text' size=17 /></td><td><input name='DeviceNumber[]' type='text' size=20 /></td>";
html+="<td><input name='Mointor[]' type='text' /></td><td><input name='DVD[]' type='text'/></td>";
$("select option:selected").prependTo("attr(name='DVD')");
<td><select name="Depart" >
<option>所有部门</option>
<?php
$conn=mysql_connect("localhost","root","") or die('连接失败'); mysql_select_db("departpc",$conn) or die('连接数据库失败'); mysql_query("SET NAMES 'gb2312'");
$sql="select * from depart";
$result=mysql_query($sql,$conn);
while($row=mysql_fetch_array($result))
{
echo '<option>'.iconv('gb2312','utf-8',$row[1]).'</option>';//输出部门名
}
?>
</select></td>
还是无法显示!谢谢大家关注
html+="<td><select name=\"Depart\" >";
html+="<option>所有部门</option>";
<?php
$conn = mysql_connect ( "localhost", "root", "%$!**" ) or die ( '连接失败' ); //连接服务器
mysql_select_db ( "kongquewatchpc", $conn ) or die ( '连接数据库失败' ); //选择数据库
mysql_query ( "SET NAMES 'gb2312'" ); //设置字符集
$sql = "select * from kongquedepart";
$result = mysql_query ( $sql, $conn );
while ( $row = mysql_fetch_array ( $result ) ) {
echo 'html+="<option>' . iconv ( 'gb2312', 'utf-8', $row [1] ) . '</option>";' . "\r\n"; //输出部门名
}
?>
感谢老牛指导,哈哈,博客园里好象人少了吗?也没人跟贴,郁闷!!!!