Home >Backend Development >PHP Tutorial > 查询语句有异常,找了好久都没有发现,哪位高手帮小弟我看看
查询语句有错误,找了好久都没有发现,谁帮我看看!
我设的条件是number=512在数据库中符合条件的只有一条记录,但每次遍历输出把所有的数据都输出了?
一直都找不到原因.
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> $sql = "select * from `test` where number=512"; $sqlm = mysql_query($sql); while($row = mysql_fetch_array($sqlm)){ ?> <tr> <td id="photo" rowspan="6"><img src="" alt=" 查询语句有异常,找了好久都没有发现,哪位高手帮小弟我看看 " ></td> <td class="td1">姓名:</td> <td class="td2"><?php echo $row[name];?></td> <td class="td1">性别:</td> <td class="td2"><?php echo $row[sex];?></td> </tr> <tr> <td class="td1">出生日期:</td> <td class="td2"><?php ?></td> <td class="td1">年龄:</td> <td class="td2"><?php ?></td> </tr> <tr> <td class="td1">现居地:</td> <td colspan="3" class="td2"><?php ?></td> </tr> <tr> <td class="td1 td3">备注:</td> <td colspan="3" class="td2"><?php ?></td> </tr> <?php } ?>