简体   繁体   中英

PHP MYSQL - Memory - Unable to save result set in

I have a database with 150k records which doesn't sound like a lot. The problem I have having is that when i run a search with no filers (returning all 150k records) i "get Unable to save result set in", but when i add a filter that cuts the results it half it works fine. Also when i run it in phpmyadmin it works fine.

It only gets this error when i run the sql in the browser. After googling, I found that it may be something with memory in the browser not being able to return that many results.

Can someone explain this to me and more importantly provide me with a solution so that i can return all 150k records without error.

Thank you.

当结果集可能足够大而导致内存耗尽时,请使用无缓冲查询http://php.net/manual/zh/mysqlinfo.concepts.buffering.php

You should try to increment the memory limit for your PHP script.

Try putting:

ini_set('memory_limit', '128M');

at the beginning of your script.

See also:

http://php.net/manual/en/function.ini-set.php

http://php.net/manual/en/ini.core.php

Sometimes a broken MySQL table may cause this warning. If you think enough memory to handle your result set, simply check your table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM