php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6598 Memory overflow
Submitted: 2000-09-07 08:17 UTC Modified: 2001-05-06 11:11 UTC
From: artem at osp dot ru Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.1pl2 OS: Linux
Private report: No CVE-ID: None
 [2000-09-07 08:17 UTC] artem at osp dot ru
When I try to get dump of my table (about 5.000.000 records) cause memory overflow.
When I check problem, I found, that php always use mysql_store_result(), and never mysql_use_result() 
(from C API).
At mysql (comand line tool) I can use option -q. which forse use mysql_use_result().
I need someting like in php. 
Maybe as additionall argument in mysql_query,
maybe as constant in configuation file, maybe other.


<?PHP
 mysql_connect("localhost","...","...");
 mysql_select_db("...");
 $res=mysql_query("select * from big_table");
 $row=mysql_fetch_row($res);
 echo $row[0];
 mysql_free_result($res);
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-02 07:15 UTC] stas@php.net
Well, mysql_use_result is not too nice - it basically ties down your connection and any tables used until the end of the operation... But maybe it should indeed be possible to use this with some parameter to mysql_query.
 [2001-05-06 11:11 UTC] derick@php.net
In php 4.0.5 there is a new function, called mysql_unbuffered_query() which will do this for you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC