You are here: Re: Only showing 20 lines per page... « All PHP « IT news, forums, messages
Re: Only showing 20 lines per page...

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация