Re: MySQL C API multiple connections

2001-01-13 Thread Sinisa Milivojevic
alex writes: > > > > By the way it seems to me that in 3.23.XX series mysql_init() returns address not > of the starting point of the allocated memory pool but a point somewhere further > (like to provide hidden data not included in "official" MYSQL structure). Hence > when trying to use

Re: MySQL C API multiple connections

2001-01-12 Thread alex
Sinisa Milivojevic wrote: > > Hi! > > I made an error in my previous message. All three instances should be > like this: > > connX = mysql_init(NULL); > if (!mysql_real_connect(connX, ip2, user2, pass2, db2, 0, NULL, 0)) > error . > By the way it seems to me that in 3.23.XX series mys

Re: MySQL C API multiple connections

2001-01-12 Thread Sinisa Milivojevic
Valerio Ferrucci writes: > John Dean wrote: > > > Hi > > I think you should check the API documentation > > Can you point me to some docs about this? > > > because you code example is > > wrong. Each connection should have its own initialized connection handle. > > You have only initi

Re: MySQL C API multiple connections

2001-01-12 Thread Sinisa Milivojevic
Valerio Ferrucci writes: > Hi, > I'm building a MySQL C API client. I need to connect to different dbs > at the same time. My code is (approximately): > > // > MYSQL mysql, *conn1, *conn2; > > mysql_init(&mysql) > > conn1 = mysql_real_connect(&mysq, ip1, u

RE: MySQL C API multiple connections

2001-01-12 Thread Narvaez, Teresa
Valerio, It seems to me, that you need to init (mysql_init) serveral times; I have not tried this but I would try the following: MYSQL conn1, conn2, conn3; conn1 = mysql_init(NULL) if ( mysql_real_connect(conn1, ip1, user1, pass1, db1, 0, NULL

Re: MySQL C API multiple connections

2001-01-12 Thread Valerio Ferrucci
John Dean wrote: > Hi > I think you should check the API documentation Can you point me to some docs about this? > because you code example is > wrong. Each connection should have its own initialized connection handle. > You have only initialized one data structure i.e. mysql, which is passed >