-- Aljosa Mohorovic <[EMAIL PROTECTED]> wrote
(on Thursday, 01 November 2007, 02:23 PM +0100):
> i use Zend_Db_Table_Abstract and this error occurs when i call fetchAll():
> 
> Fatal error: Out of memory (allocated 4718592) (tried to allocate
> 4294967294 bytes) in
> /home/aljosa/[...]/library/Zend/Db/Statement/Mysqli.php on line 227
> 
> i guess this is probably a bug in mysqli driver but i need to use
> mysqli because i have no choice.

Then you need to up your memory limit, as you're fetching more rows than
you have memory to store in your PHP process. The other option is to
limit the number of items you pull.

> also, if i dont use set_charset('utf8') on link i just get blank page.

Then your data is likely being stored in utf8. 

> anybody knows what could i do? any ideas how to fix this?
> 
> Aljosa
> 
> # connection
> $db = Zend_Db::factory(
>     'MYSQLI',
>     array(
>         'host' => 'localhost',
>         'username' => 'user',
>         'password' => 'pass',
>         'dbname'   => 'db'
>     )
> );
> $link =& $db->getConnection();
> $link->set_charset('utf8');
> Zend_Db_Table_Abstract::setDefaultAdapter($db);
> 
> # news table
> class News extends Zend_Db_Table_Abstract {
>     protected $_name = 'news';
> }
> 
> # part where it breaks
> $news_tbl = new News();
> $itms = $news_tbl->fetchAll();
> 

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to