Re[2]: [PHP-DEV] PHP 4.0 Bug #6598 Updated: Memory overflow
| From: | Artem V. Ryabov | Date: | Fri, 03 Nov 2000 07:36:54 +0000 |
| Subject: | Re[2]: [PHP-DEV] PHP 4.0 Bug #6598 Updated: Memory overflow | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-36913@lists.php.net to get a copy of this message | ||
Hello Ignacio,
Thursday, November 02, 2000, 10:55:26 PM, you wrote:
Of course, I know, that mysql_use_result() have many restrictions.
I don't try to use this by default.
It's only for _special_ cases.
IVA> On 2 Nov 2000 stas@php.net wrote:
>> ID: 6598
>> Updated by: stas
>> Reported By: artem@osp.ru
>> Status: Analyzed
>> Bug Type: MySQL related
>> Assigned To:
>> Comments:
>>
>> 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.
>>
>> Previous Comments:
>> ---------------------------------------------------------------------------
>>
>> [2000-09-07 08:17:14] artem@osp.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);
>> ?>
>>
>> ---------------------------------------------------------------------------
>>
>>
>> Full Bug description available at:
>> http://bugs.php.net/?id=6598
>>
IVA> I discovered something about this when one of my coworkers asked a
IVA> question about going to the beginning of the data
IVA> set: mysql_data_seek() can only be used on results pulled using
IVA> mysql_store_result, not mysql_use_result.
--
Best regards,
Artem mailto:artem@osp.ru