<?php<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><link type="text/css" rel="stylesheet" href="../css/admin.css" /><title>學生信息</title></head><div style="position:absolute;top: 140px ; left:330px; "><body><?PHP?$sql1="select * from hourse $where order by hname desc $limit"; //此處加了降序$res=mysql_query($sql1);?><div></div><form action="lf_del.php" method=post>?<table width="1000">? <tr? width="100%">? ? <h2?>公寓信息</h2>? </tr>? <tr>? ? <th width="35">選項</th>? ? <th width="12%">公寓名 </th><th width="10%">居住性別 </th>? ? <th width="11%">房間數 </th>? ? <th width="11%">樓層數 </th><th width="13%">應住人數 </th>? ? <th width="13%">實住人數 </th>? ? <th width="15%">操作</th>? </tr>? <?PHP?while($rows=mysql_fetch_array($res)){$sqladd2="update hourse set snumber='$totalnum2' where hid=$rows[0]";mysql_query($sqladd2,$link);$yingzhu=$rows[3]*$rows[4]*8;$sqladd="update hourse set ynumber='$yingzhu' where hid=$rows[0]";mysql_query($sqladd,$link);?>? <tr>? ? ?<td width="6%"><input type=checkbox name=de[] value=<?php echo $rows[0];?>></td>? ? <td width="14%"><?php echo $rows[1];?> </td><td width="11%"><?php echo $rows[2];?> </td>? ? <td width="11%"><?php echo $rows[3];?> </td>? ? <td width="11%"><?php echo $rows[4];?> </td>? ? <td width="13%"><?php echo $yingzhu;?> </td>? ? <td width="13%"><?php?$sqlshizhu="select sum(rshi) from room where rhourse=$rows[hname]";? ? $shizhu=mysql_query($sqlshizhu,$link);? ? $rs=mysql_fetch_array($shizhu);echo $rs["sum(rshi)"];?> </td>? ? <td width="15%"> <a href="lf_update.php?id=<?php echo $rows[0];?>">修改</a>?? </tr>? <?php}?></table></form></body></div></html>當倒數14行$rows[hname]數組里的內容是文字時計算不出實住人數為甚么?當內容為數字1233時就可以,注意是內容不是$rows[hname]里的hname。請問這個問題怎么解決呢,謝謝幫忙?。。?!
添加回答
舉報
0/150
提交
取消