Returns the ID of the current record.
int i5_bookmark (resource result/file)
Parameters
file |
IBM i file resource |
Return
The ID of the current record that can be used with i5_data_seek() to position on this record again.
I5_ERR_PHP_HDLBAD |
258 |
Bad connection handle |
I5_ERR_PHP_RESOURCE_BAD |
261 |
No resource found. |
I5_ERR_PHP_TYPEPARAM |
262 |
Type of element x in parameter -1 must be y. Type z was provided. |
I5_ERR_PHP_NBPARAM_BAD |
263 |
Wrong parameter count |
Details
A bookmark is an ID (in fact the record number) allowing to mark the current record to be able to come back to it later using i5_data_seek function.
Example
$file = i5_open('EASYCOM/NCLIENT');
/* Looking for MARTIN */
$seek = array("MARTIN");
$ret = i5_seek($file, I5_EQ, $seek);
$rec = i5_fetch_row($file, I5_READ_SEEK);
/* Set a bookmark on current record */
$dupont = i5_bookmark($file);
[... other treatments on the file ...]
/* Direct return to back to DUPONT record */
$ret = i5_data_seek($file, $dupont);
$rec = i5_fetch_row($file, I5_READ_SEEK);
print_r($rec);echo "<BR>";
See also