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 initialized one data structure i.e. mysql, which is passed
 > > three times to mysql_real_connect, so of course conn1 == conn2.
 > 
 > You are saying that the good code is:
 > 
 > mysql_init(&mysql1)
 > conn1 = mysql_real_connect(&mysq1, ip1, user1, pass1, db1, 0, NULL, 0)
 > 
 > mysql_init(&mysql2)
 > conn12= mysql_real_connect(&mysq2, ip2, user2, pass2, db2, 0, NULL, 0)
 > 
 > ...?
 > 
 > > And why are
 > > passing a reference to the MYSQL data structure and not a pointer?
 > 
 > What do you mean, the typecast ((Ptr)&mysql)?
 > 


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 .....


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

Reply via email to