Try using mysql_free_result each time after fetching the rows.

SB
----- Original Message -----
From: "Ganbold" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 4:27 PM
Subject: Help! problem using MySQL C API


> Hi,
>
> I'm having trouble writing dial-up user billing software in C using MySQL
C
> API.
> Program suppose to send query to mysql server and retrieve records and
> process those.
> It sends query for each class_id for every day and get records from
> ACCOUNTING table.
> While retrieving records it adds user in linked list if user doesn't
exist.
> There will be total not more than 1000 users
> per one day with duration, number of session, time_stamp etc. After adding
> user to linked list it calculates
> the charges for duration that he connected to Internet. In order to
> calculate charge it sends various queries to
> various tables to get data. Program is working fine for one day. But when
I
> try to calculate from beginning of the
> month, after 2 days program crashes saying:
>
> "Out of memory (Needed 8164 bytes)
> select charge,from_min,to_min,class_id,id from customers.intervals where
> class_id='19' order by id query failed!"
>
> when sending trying to send query to get data for calculation.
>
> I think there are some problem with memory management, but when I just run
> program without calculating charges
> it works just fine.
>
> Can somebody recommend me better way of handling in this situation? Is
this
> good choice to use linked list in this case?
> Is there any other good resource for writing mysql client in C on the web?
> Please let me know if somebody knows and solved this problem before.
> Please give me some recommendation in this regard.
>
> I'm using FreeBSD 4.6-STABLE, with 512 MB RAM and 50GB HDD with 6GB of
free
> space.
> MySQL version is :3.23.38
>
>
> thanks in advance,
>
> Ganbold
>
>
>




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to