问个大家一直困扰到我的问题
悬赏分:20 -
2007年08月22日
<?
include("sbconfig.php");
?>
设备维护表
<?
if(empty($_POST["yue"]))
{
exit;
}
?>
| 设备名称 |
所属单位 |
类型 |
检查 |
进入 |
<?
$yue=$_POST["yue"];
$danw=$_POST["danwei"];
$lx=$_POST["leixing"];
$i=0;
$db=mysql_connect($servername,$sqlservername,$sqlserverpws) or die("数据库连接失败,请检查!");
mysql_select_db($sqlname,$db);
$sql="select * from $sqltable1 where $yue='wh' and danwei='$danw' and leixing='$lx'" ;
$conn=mysql_query($sql) or die(mysql_error());
while($rs=mysql_fetch_array($conn)){
$nm = $rs["name"];
$danwe = $rs["danwei"];
$sql2="select * from $sqltable2 where name='$nm' and danwei ='$danwe'and month = '$yue' ";
$conn2=mysql_query($sql2) or die(mysql_error());
while($rs2=mysql_fetch_array($conn2)){
echo($rs2["name"]);
}
}
?>
为什么在$sqltable2 表中的数据出不来哪?
难道是WHILE的双重循环有问题吗?
谢谢大家看看
提问者:hewei19810821 08-22 09:09