|
Posted by Rik on 07/16/06 18:22
Mike wrote:
>> With a simple calculation of records per page, total records &
>> requested pagenumber you'll only have to retrieve the relative
>> resultset from the database, which will mean less resource use with
>> both database & PHP. Your mentioning of 'storing the results to an
>> array and looping through that way' get's me a bit confused. It'd be
>> a waste to turn it into an array, and then proceed. Why not
>> mysql_fetch_array() the rows and perform your desired actions
>> immediately?
>>
> I thought mysql_fetch_array() did store the results in an array?
>
> Mike
Yes and no, it stores 1 row in an array, not the entire resultset, which is
what got me confused.
When a result is:
+---------+-------+
| article | price |
+---------+-------+
| 0001 | 3.99 |
| 0002 | 10.99 |
| 0003 | 1.69 |
| 0004 | 19.95 |
+---------+-------+
mysql_fetch_array() will contain the first row (and move the pointer to the
second):
array {
[article] => 0001,
[price] => 3.99
}
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|