00 mysql上一条,下一条

Post date: 2012/4/3 上午 05:55:04

function seek_pos($SQL, $pos=0) {

......省略部分

$result = mysql_query($SQL);

$row = array();

if (mysql_data_seek($result, $pos)) {

$row = mysql_fetch_assoc($result);

}

retunrn $row;

}

$row = seek_pos($sql, 0);

var_dump($row);

$row = seek_pos($sql, 1);

var_dump($row);

$row = seek_pos($sql, 2);

var_dump($row);