I want to do relative seek on a mysql resultset, more specifically +1/-1 seeks.
The 开发者_Go百科function mysql_data_seek()
provides absolute seek and there does not seem to any method to get current row number!! (Should I implement my own counter, it would require updating a large code base)
For +1, mysql_fetch_array() would do the trick but still I need a solution for -1.
So there is no solution.
Seems to be a design flaw in php mysql api. It provides the expensive operation (seeking) but not the cheap one ( getting current row number).
EDIT: I checked with PHP team, mysql api is frozen and only accept bug fix. I should switch to mysqli.
精彩评论