上面写错了,是
mysql_data_seek($result,($notepage-1*10)

解决方案 »

  1.   


    给你两种思路
    1. mysql_data_seek($result,($notepage-1*30))$sql="select * from table ".$query_condition;  //查询条件组合部分,你自己组合$result = mysql_query($sql);for ($i = ($notepage-1*30)) - 1; $i <= notepage; $i++) {
            if (!mysql_data_seek($result, $i)) {
                echo "Cannot seek to row $i: " . mysql_error() . "\n";
                continue;
            }
    if(!($row = mysql_fetch_object($result)))
                continue;echo "$row->last_name $row->first_name<br />\n";}
    mysql_free_result($result);
    2.利用limit来做,这样选择出来的数据最少
    $sql="select * from table ".$query_condition." limit ($notepage-1*30),$notepage"; 
    $result=mysql_query($sql);
    while($rs=mysql_fetch_row($result))
    {
      print_r($rs);
    }建议mysql的分页采用第二种方式