★ wanayoo — archive 1999 http://www.php.net/manual/function.sybase-num-rows.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Sybase
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
Sybase
* sybase_affected_rows
* sybase_close
* sybase_connect
* sybase_data_seek
* sybase_fetch_array
* sybase_fetch_field
* sybase_fetch_object
* sybase_fetch_row
* sybase_field_seek
* sybase_free_result
* sybase_num_fields
* sybase_num_rows
* sybase_pconnect
* sybase_query
* sybase_result
* sybase_select_db
Manual: sybase_num_rows
View the source code for this pageSearch the site



Previous page
 sybase_num_fields
 Updated
Sat, 12 Aug 2000
sybase_pconnect 
Next page


sybase_num_rows

(PHP3 , PHP4 )

sybase_num_rows -- get number of rows in result

Description

int sybase_num_rows (string result)

sybase_num_rows() returns the number of rows in a result set.

See also: sybase_db_query(), sybase_query() and, sybase_fetch_row().


User Contributed Notes: sybase_num_rows


verdy_p@wanadoo.fr
24-Jul-1999 03:32
Because Sybase does not process the number of returned rows until all rows have been fetched, this function should be avoided if the query returns MANY rows: PHP3 will have to fetch internally all rows coming from the server, keeping results in memory until the result set is fully returned and no more rows are signaled by the SQL Server. If you want to put a limit on the number of rows to really fetch in your application, it will be much faster to first select the count of rows that match the search criters, prior to select effective data. Shame, the current implementation of PHP3 Sybase support functions does not have an option to control whever all rows should be fetched prior to return from the query. More, there's no provision for queries that return multiple results sets, so this function terminates the current query without allowing further results sets to be returned. A good idea would be that this function processes only the current result set, but does not terminate the query, allowing the script to use either a new "sybase_next_result()" or "sybase_free_result()" after processing the current dataset.
The current implementation of this function fetches all pending rows in memory, which updates the counter that is otherwised set up for the sybase_affected_rows(). If you don't call this function, sybase_affected_rows() is not accurate for the current selected result set because all rows have not been internally fetched. If you just want to show the total number of rows displayed on your HTML page, it's a good idea to call it only AFTER all rows have been fetched, because this count is immediately accurate without requiring PHP3 to fetch pending rows and save them in internal memory.



 About Notes


Previous page
 sybase_num_fields
 Updated
Sat, 12 Aug 2000
sybase_pconnect 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.