mysql_num_rows
取得传回列的数目。语法: int mysql_num_rows(int result);

解决方案 »

  1.   

    刚才没有仔细看。
    $i = 0;
    while ($row=mysql_fetch_row($result)){
    ?>
              <table border=1 cellpadding=0 cellspacing=0>
                <tbody> 
                <tr> 
                  <form action=edit_type.php method=post>
                    <td height="22"> 
                      <input type="submit" name="del" value="删除">
                    </td>
                    <td height="22">                 
                      <input name="type_name" value="<? echo $row[$i];?>">
                    </td>
                    <td height="22"> 
                      <input type="submit" name="repire" value="修改">
                    </td>
                  </form>
                </tr>
                </tbody> 
              </table>
    <?
    $i++;
    }
    ?>
      

  2.   

    <?
    $connection = @mysql_connect("localhost","root","root" )or die("无法连接到数据库!");  
    @mysql_select_db("book",$connection)or die("无法选择数据库!"); 
    $query = "select * from type order by type_id desc";
    $result = @mysql_query($query,$connection) or die ("数据库调用失败!");
    $row=mysql_fetch_array($result);
    $j=mysql_num_rows($result);
    for($i=0;$i<$j;$i++){
    ?>
              <table border=1 cellpadding=0 cellspacing=0>
                <tbody> 
                <tr> 
                  <form action=edit_type.php method=post>
                    <td height="22"> 
                      <input type="submit" name="del" value="删除">
                    </td>
                    <td height="22">                 
                      <input name="type_name" value="<? echo $row["type_name"];?>">
                    </td>
                    <td height="22"> 
                      <input type="submit" name="repire" value="修改">
                    </td>
                  </form>
                </tr>
                </tbody> 
              </table>
    <?
    }
    ?>
      

  3.   

    webmin(webmin) 
    还是不行,只有第一条记录
      

  4.   

    junxiao(骏枭) 
    这样肯定不行的
      

  5.   

    echo $j;
    看总共多少条记录?
    for($i=0;$i<$j;$i++){.....$row=mysql_fetch_array($result);
    }
      

  6.   

    将 
                    原文中的  <input name="type_name" value="<? echo $row[$i];?>">  $row[$i]该为 $row["字段名称"];
      

  7.   

    同意楼上的 
    用$row=mysql_fetch_array($result);
    $row是命名数组
    应该使用
    $row['字段名']来调用
      

  8.   

    $row=mysql_fetch_array($result);
    这一句应在 for循环里面才行!!!
      

  9.   

    我的方法
    ...
    $j=0;//$j 用来计量有多少条记录
    while(list($tpye_name)=mysql_fetch_array($result))
    {
    ?>          <table border=1 cellpadding=0 cellspacing=0>
                <tbody> 
                <tr> 
                  <form action=edit_type.php method=post>
                    <td height="22"> 
                      <input type="submit" name="del" value="删除">
                    </td>
                    <td height="22">                 
                      <input name="type_name" value="<? echo $row[$i];?>">
                    </td>
                    <td height="22"> 
                      <input type="submit" name="repire" value="修改">
                    </td>
                  </form>
                </tr>
                </tbody> 
              </table>
    <?}?>
    应该可以
      

  10.   

    我的方法
    ...
    $j=0;//$j 用来计量有多少条记录
    while(list($tpye_name)=mysql_fetch_array($result))
    {
    ?>          <table border=1 cellpadding=0 cellspacing=0>
                <tbody> 
                <tr> 
                  <form action=edit_type.php method=post>
                    <td height="22"> 
                      <input type="submit" name="del" value="删除">
                    </td>
                    <td height="22">                 
                      <input name="type_name" value="<? echo $row[$i];?>">
                    </td>
                    <td height="22"> 
                      <input type="submit" name="repire" value="修改">
                    </td>
                  </form>
                </tr>
                </tbody> 
              </table>
    <?}?>
    应该可以