//找出第一条记录的记录号 $query_string = "SELECT * FROM table Order By id DESC"; $query_string = odbc_exec($conn_id,$query_string); odbc_fetch_into($query_string,$firstshow,&$idarea); $idsql = $idarea[0];
//定位查找 if ($pages == $pagecount) { $rs = "SELECT * FROM table where id <= '".$idsql."' Order By id DESC"; }else{ $rs = "SELECT Top ".$pagesize." * FROM table where id <= '".$idsql."' Order By id DESC"; };