<?php
include("connect.php");
$query="select * from m_value";
$result=mysql_query($query,$link);
$row=mysql_fetch_array($result);
echo $row[Id];
$row=mysql_fetch_array($result);//取下一条数据
echo $row[Id];
?>

解决方案 »

  1.   

    楼主,按你说的,我怎么没有出现这种情况呢?
    $sql=mysql_query("select * from 表 order by 字段 desc");
    while($data=mysql_fetch_array($sql)) {
       echo $data["字段"];
       echo "line";
       echo "<br>";
    }
      

  2.   

    $res=mysql_query("select * from music order by id");
    $cell_max = 4;
    $cell = 0;
    $table="";
    while($row=mysql_fetch_array($res)) {
    if($cell == 0) $table.= "<tr align=center>";
    if($row[link]) {
    $link1="<a href=music.php?step=down&id=$row[id] class=musichref target=_blank>";
    $link2="</a>";
    }
    if($row[word]) $word=" <a href='javascript:void(0)' onclick=\"window.open('music.php?step=mini&id=$row[id]','_blank','toolbar=no,scrollbars=yes,resizable=yes,menubar=no,location=no,top=0,left=0,width=330,height=300')\"><font color=#CC66CC>歌词</font></a>";
    $table.= "<td height=20><font color=#ECCEA6>$row[id]</font> $link1$row[name]$link2$word</td>";
    $cell = ($cell+1)%$cell_max;
    if($cell == 0) $table.= "</tr>";
    }这样一个,其中又的link字段是没有内容的,但是我发现得出的结果还是有,就是继承了上一次的值。