(PHP 4 >= 4.0.1, PECL yaz >= 0.9.0)

yaz_range مشخص کردن بازه رکوردهای مورد بازیابی


void yaz_range ( resource $id , int $start , int $number )

مشخص کردن بازه رکوردهای مورد بازیابی.

این تابع باید پیش از yaz_search() یا yaz_present() فراخوانی شود.



منبع اتصال بازگردانده شده توسط yaz_connect().


مشخص کردن موقعیت اولین رکورد برای بازیابی. شماره رکوردها از 1 تا yaz_hits() است.


مشخص کردن تعداد رکوردهای مورد بازیابی.

Return Values

No value is returned.

add a note add a note

User Contributed Notes 1 note

andrew dot isherwood at ptfs-europe dot com
1 month ago
Note that yaz_range probably doesn't do what you think it's going to to do. i.e. cause the result set to be returned according to the "start" and "number" parameters you supply.

Quoting this thread:

"Generally, the record offset that you give to yaz_record() is the offset into the result set, not into any subset identified by yaz_range(). This is crucial: The yaz_range() function is strictly there to help you write more optimized client code; you do not need to call it.

In other words, if you want to display record numbers 10 to 20 from your set, you loop from 10 to 20 and call yaz_record() for each record. The underlying code will retrieve records as necessary on demand.

However, if you call yaz_range() before you call yaz_wait(), the underlying code will optimize it's behavior.. it will either ask the
server to return records along with the search recult, or submit a single present request to fetch the records (if you're not asking for too many).. it makes no difference in a quick hack, but it can make a dramatic difference if you're designing for many users or heavy traffic. Your loop over yaz_record() will be the same whether you have called yaz_range() first, or not."
To Top