......
没报错???
你的while怎么没有结束的???
没报错???
你的while怎么没有结束的???
解决方案 »
- 请教,验证码的PHP文件,为什么不能有HTMl标签
- php中删除数据库中不匹配的记录
- 想用SESSION保护多个网页
- 在ie上可用,但在firefox上却不行,请问怎么回事
- 想了半天真想把比尔盖茨搞死,大家进来评论一下,唉...............................
- php 连接mssql的问题?
- 某段代码 放在其他php文件中没有任何waring和error 可是放在默认的文件index.php中就有waring
- ****************菜鸟遇到的大难题,架设一个简单的OA系统**********************
- 有人知道www.nt.com.cn(www.chinaasp.com)为什么去不了了吗?
- 关于php分词搜索准确率,求思路
- php客户端调用.net的Web Service -----怎样实现
- php编译
<?
while($row =mysql_fetch_array($result)) {
$name =$row["name"];
}
?>
这样只显示一条记录,怎么循环显示多条?
<?php
$conn=mysql_connect('localhost','root',"");
$db=mysql_select_db('student',$conn);
$result=mysql_query('select * from info');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显示的数据</title>
<style type="text/css">
<!--
.style1 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
</head><body>
<?
while($row =mysql_fetch_array($result)) {
$name =$row["name"];
?><table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><span class="style1">查询的数据</span></td>
</tr>
<tr align="center">
<td width="30" height="20"> 姓名</td>
</tr>
<?
while($row =mysql_fetch_array($result)) {
$name =$row["name"];
echo "<tr><td height="20"><?=$name ?></td></tr>";
?>
</table>
</body>
</html>
while($row =mysql_fetch_array($result)) {
$name =$row["name"];
?><table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><span class="style1">查询的数据</span></td>
</tr>
<tr align="center">
<td width="30" height="20"> 姓名</td>
</tr>
<tr>
<td height="20"><?=$name ?></td> </tr>
</table>
<?php
}
?>
</body>
</html>
$conn=mysql_connect('localhost','root',"");
$db=mysql_select_db('student',$conn);
$result=mysql_query('select * from info');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>显示的数据</title>
<style type="text/css">
<!--
.style1 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
</head><body>
<table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><span class="style1">查询的数据</span></td>
</tr>
<tr align="center">
<td width="30" height="20"> 姓名</td>
</tr>
<?
while($row =mysql_fetch_array($result)) {
$name =$row["name"];
echo "<tr><td height="20"><?=$name ?></td></tr>";
}
?>
</table>
</body>
</html>---------
楼上的作废...