Table of Contents

Syntax

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.

What it Does

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.

Example

// 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!';
 
mysql_data_seek.txt · Last modified: Apr 18, 2008 - 2:00pm (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki