problem using MySQL++ API
hello, I am using mysql++ API and it is giving an error - The procedure entry point mysql_connect could not be located in the dynamic link library LIBMYSQL.dll any solutions, Best Regards - Pawan Have A Nice Day
Problem using mysql
Hello! My name is Sergiu and I'm a software engineer from Romania. I have a problem using MySql and I hope you can give me an answer at my problem. The MySql server worked without any problem until I installed on the same machine the Visual Studio .Net 7.1 package. After I installed this package, I observed that I can't use my database from MySql. Also, the mysql.exe file for starting the MySql console doesn't work. The MySql server is running, but my databases aren't visible. Can you tell me what the problem can be? Maybe that package installed some components that affect MySql application? I had the same problem using MySql when I tried to install JBuilder application. I thank you in advance for your help. Best regards, Sergiu Muresan
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 Below is my code snippets: - typedef struct user_b{ int contract_id; int class_id; char *username; int numSession; long time_stamp; long duration; double pre_balance; double due_balance; double total; double tax; double payment; int discount; int is_payed; /* 1 for true, 0 for false */ int location_id; struct user_b *next; } USER; Main code USER *customer_list; customer_list = NULL; for(i=day;i0;i--){ deleteTableEntry(fp,i,billing_test); if(customer_list!=NULL){ customer_list = destroyUserList(customer_list); /* destroy user list */ } customer_list = prepareUser(fp,customer_list,i,daytime,nighttime); writeBillingTable(fp,customer_list); writePaymentTable(fp,customer_list); } if(customer_list!=NULL){ customer_list = destroyUserList(customer_list); /* destroy user list */ } Functions /*-*/ USER *installUser(FILE *logfile, USER *pslist,USER **curr, char *userid, int class_id, int contract_id, long duration, long time_stamp, int day) /* Parameter: USER **curr - pointer to pointer to current user */ { USER *p; USER *prev; /* pointer to previous element in list */ double amount; if((p = searchUser(pslist,prev,userid))==NULL){ /* if user is not in list */ /* allocate memory */ p = (USER *) malloc(sizeof(USER)); /* if unsuccessfully allocated */ if(p ==NULL || (p-username = my_alloc(userid)) ==NULL){ fprintf(stderr,Out of memory while allocating!\n); exit(4); } p-class_id = class_id; p-contract_id = contract_id; p-duration = duration; p-time_stamp = time_stamp; p-numSession = 1; /* add user to our linked list in appropriate place */ if(prev == NULL){ /* in the beginning or to null list */ p-next = pslist; pslist = p; }else{/* in the middle or at end */ p-next = prev-next; prev-next = p; } }else{ p-duration += duration; p-numSession++; } /* calculate charges */ amount = applyIntervals(logfile, day, class_id, time_stamp, duration,p-duration,p-total); amount = applyTimeFrame(logfile, day, class_id, time_stamp, duration,p-duration,p-total); amount = applyClassInfo(logfile, day, class_id, time_stamp, duration,p-duration,p-total); /* current is now points to existing user or to new user */ *curr = p; /* return pointer to our list */ return pslist; } /* end installUser */ /*-*/ USER *prepareUser(FILE *logfile, USER *customer_list, int day, char *day_time, char *night_time) { MYSQL_RES *res_set; MYSQL_ROW row; char query[BUF]; USER *curr; /* pointer to current elem */ char *morning; char *midnight; int session,contract_id,class_id; long time_stamp;
Re: Help! problem using MySQL C API
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
Problem using mysql++
Okay i manage to build mysql++ after building gcc 2.95.3.Now i have problem in making c++ programs to run with mysql++. I try to compile the following code #include sqlplus.hh #include iomanip.h #include iostream.h int main() { connection conn(mysql); Query query = conn.query(); queryselect * from test; Result res = query.store(); coutresult size : res.size(); return 1; } I try first by using the following : g++ main.cc by i get a whole list errors that look something like : /tmp/cc9gbBwd.o (FieldType::gnu.linkonec...:undefine reference to 'FileTypes::int(). collect2: ld returned 1 exit status then i try to do this : g++ main.cc -lsqlplus this manage to compile the code but when i try to run the program with ./a.out,i get the following error: ./a.out : error in loading shared libraries : libsqlplus.so.1 : cannot open shared object file : No such file or directory. the libsqlplus.so.1 file is found in the /usr/local/lib/ directory. I build mysql++ using default options. Please help, thanks in advance. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - 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
Problem using mysql++-1.7.8.tar.gz
Hi all, What's wrong with this Updating makefiles Considering target file 'Makefile'. Considering target file 'Makefile.in'. Considering target file 'Makefile.am'. Looking for an explicit rule for 'Makefile.am'. Trying pattern rule with stem 'Makefile.am'. Trying implicit prerequisite 'Makefile.am'. ... . No implicit rule for 'makefile.am' Finished prerequisites of target file 'Makefile.am' No need to remake target file 'Makefile.am' Considering target file 'Makefile.am'. . .. I only add this row before int main() #include sqlplus.hh I am using kdevelop 1.3 MYSQL 3.23.32 and Linux Suse 7.0 I add too these lines in Project/option: -I/usr/include/mysql (compile option) and /usr/local/lib/libsqlplus.a (linking option) Thanks Patrick - 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
Re: Problem using mysql++-1.7.8.tar.gz
Patrick Vogel writes: Hi all, What's wrong with this Updating makefiles Considering target file 'Makefile'. Considering target file 'Makefile.in'. Considering target file 'Makefile.am'. Looking for an explicit rule for 'Makefile.am'. Trying pattern rule with stem 'Makefile.am'. Trying implicit prerequisite 'Makefile.am'. ... . No implicit rule for 'makefile.am' Finished prerequisites of target file 'Makefile.am' No need to remake target file 'Makefile.am' Considering target file 'Makefile.am'. . .. I only add this row before int main() #include sqlplus.hh I am using kdevelop 1.3 MYSQL 3.23.32 and Linux Suse 7.0 I add too these lines in Project/option: -I/usr/include/mysql (compile option) and /usr/local/lib/libsqlplus.a (linking option) Thanks Patrick Hi! You should run: automake autoconf ./configure (with options of your choice) make You should use all latest GNU tools for the above, including GNU make, GNU libtool etc .. Regards, Sinisa __ _ _ ___ == MySQL AB /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic /*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED] /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus /*/ /*/ /*/\*\_/*/ \*\_/*/ |*| /*/^^^\*\^^^ /*/ \*\Developers Team - 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