2008年10月31日星期五

Re: [fw-db] Parsing through large result sets

Luiz my dear friend...

You just made it to my "Top 1" list!

Thank you very much... It's exactly what I am looking for.

Have a nice weekend...

Best regards,
Jan

On Fri, Oct 31, 2008 at 13:14, Luiz Fernando <kgbfernando@yahoo.com.br> wrote:
Hi,

You can do this:
$sql = "SELECT something FROM random-table-with-an-obscene-large-amount-of-entries";
$res = $db->query($sql);
while ($row = $res->fetch(Zend_Db::FETCH_NUM)) {
// do some with the data returned in $row
}

Regards,
Luiz Fernando





De: janpolsen <janpolsen@gmail.com>
Para: fw-db@lists.zend.com
Enviadas: Sexta-feira, 31 de Outubro de 2008 8:48:49
Assunto: [fw-db] Parsing through large result sets

Oi

Now I have googled through various search queries for the last two hours and I'm about to toss the towel.

I am used to do something like this:
$sql = "SELECT something FROM random-table-with-an-obscene-large-amount-of-entries";
$res = mssql_query($sql);
while ($row = mssql_fetch_array($res)) {
// do some with the data returned in $row
}

Now I have moved over to Zend_Db and want to do the very same thing, but how?
Some places I use a simple straight through approach like:
$sql = "SELECT something FROM random-table-with-a-small-amount-of-data";
$rows = $db->fetchAll($sql);
foreach ($rows AS $row) {
// do some with the data returned in $row
}

However I run into memory problems, if I use that approach with my random-table-with-an-obscene-large-amount-of-entries.

What am I missing here? Isn't it possible to use a while()-structure to loop through a Zend_Db result set? Thanks in advance...

View this message in context: Parsing through large result sets
Sent from the Zend DB mailing list archive at Nabble.com.


Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.

没有评论: