Name

mysql_data_seek —

Synopsis

void mysql_data_seek(MYSQL_RES *res, unsigned int offset)

Moves to a specific row in a group of results. The first argument is the MYSQL_RES structure that contains the results. The second argument is the row number you wish to seek to, starting from 0. This function works only if the data was retrieved using mysql_store_result, because datasets retrieved with mysql_use_result are not guaranteed to be complete.

Example

/* Jump to the last row of the results */
mysql_data_seek(results, mysql_num_rows(results)-1);

Get Managing & Using MySQL, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.