bool mysql_data_seek(resource $result, in $rowno)
(PHP 4, PHP 5)
| $result | The query result that we want to modify. |
|---|---|
| $rowno | Offset to the row number to navigate to. This number must be between 0 and rowcount - 1. |
| RETURNS | True if the seek operation was successful, False otherwise. |
Allows you to randomly access the results of a query by seeking (or moving) the internal record pointer to the specified position. Subsequent calls to mysql_fetch… will retrieve rows starting from this position.
You can move backwards and forwards in the result set using calls to this function.
// open the mysql resource $res = mysql_connect($server, $user, $pass); // retrieve the mysql character encoding $data = mysql_query('SELECT * FROM tblState'); // attempt to seek to a specified position if (!mysql_data_seek($data, 10)) echo 'Seek to record 10 failed!';