......
没报错???
你的while怎么没有结束的???

解决方案 »

  1.   

    噢,没注意少括号了,应该是这样的:
    <?
    while($row =mysql_fetch_array($result)) {
    $name =$row["name"];
    }
    ?>
    这样只显示一条记录,怎么循环显示多条?
      

  2.   

    这样只能显示最后一条记录.循环显示要在循环中输出数据啊.
    <?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>
      

  3.   

    <?
    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>
      

  4.   

    <?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> 
    <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>---------
    楼上的作废...