fetchOne vs. fetchAll vs. Sql's limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear list,
As you already know, there are different ways to retrieve a record-set
from a database. For example, here's the classic way to perform this in PHP:

while ($row = mysql_fetch_assoc($db)) {
   // my row is available here
}

Speacking about PHP internals, what exactly happens here?
1) The PHP asks the Database-Layer to give a record in each while pass?
I mean the record-set is not available in PHP's memory, but in MySQL's Mem.

2) Or the database-layer has gave the whole result-set to PHP, and we're
just fetching a single row from PHP's memory?

3) Finally, what is the efficient way to retrieve thousands or records which
need to be processed at once? Using LIMIT?

Kind regards,
-behzad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux