Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Sybase Functions : sybase_data_seek

sybase_data_seek

Moves internal row pointer (PHP 4, PHP 5)
bool sybase_data_seek ( resource result_identifier, int row_number )

sybase_data_seek() moves the internal row pointer of the Sybase result associated with the specified result identifier to pointer to the specified row number. The next call to sybase_fetch_row() would return that row.

Parameters

result_identifier
row_number

Return Values

Returns TRUE on success or FALSE on failure.

Code Examples / Notes » sybase_data_seek

verdy_p

Use this function to skip rows in an ordered selection, for example to display only a limited ranges of rows in an HTML page, with "previous" and "next" submission buttons for the navigation. The row number may be stored in a hidden form entry or in the URL associated to the navigation links if you do not want to display forms in your page. This current row number will be submitted back to give the user the option to display other entries from the database.
However, avoid using this function to move randomly in a query result set. Note also that specifying a large number of rows to skip may be a performance issue, because the Sybase client in PHP3 will have to fetch many rows prior to find the requested row. An alternate solution is to use queries which return an ordered unique ID with each row returned, so that queries will use more efficient SQL to retrieve data rows in a BETWEEN condition in the WHERE clause, minimizing the impact of unnecessary fetched rows. Such access methods give much more productive results because it has a lower impact on the SQL server which will return small result sets.
A good way to minimize the impact of this function is to give the user the option to select more specific data with additional search fields, and forbid queries that return too many queries. You may also configure your PHP3 script so that it will limit the number of rows returned instead of providing "previous" and "next" navigation controls. Finally you may give the user an option to specify the number of rows he wants to display, and fix a limit on the specified number, so that no user will be able to display more data than this hardcoded limit in your PHP3 script.


mark

Make sure you have a data to seek, else you will get a bad row offset warning.

Change Language


Follow Navioo On Twitter
sybase_affected_rows
sybase_close
sybase_connect
sybase_data_seek
sybase_deadlock_retry_count
sybase_fetch_array
sybase_fetch_assoc
sybase_fetch_field
sybase_fetch_object
sybase_fetch_row
sybase_field_seek
sybase_free_result
sybase_get_last_message
sybase_min_client_severity
sybase_min_error_severity
sybase_min_message_severity
sybase_min_server_severity
sybase_num_fields
sybase_num_rows
sybase_pconnect
sybase_query
sybase_result
sybase_select_db
sybase_set_message_handler
sybase_unbuffered_query
eXTReMe Tracker