I am running
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$sql = "SELECT id FROM customers_old";
$old_customers = $connection->fetchAll($sql);
But it's a HUGH table and this does not fit into memory:
PHP Fatal error: Allowed memory size of 268435456 bytes exhausted
Normally I would make a loop an fetch row by row: $connection->fetch($sql)
But fetch does not exist here and fetchRow()
always returns the same row.
Solution?