Hi All

Hope you can provide some advice. I have searched the PHPBuilder forums for an answer and just wanted to know what the definitive answer would be to my question.

I have three MySQL databases and I wish to connect to all three sometimes at the same time. How do I open three separate connections to the databases?

I have noticed that some threads mention ADODB. Is this faster than the traditional method in connecting to a MySQL database?

Thanks in advance.

BB

    I have three MySQL databases and I wish to connect to all three sometimes at the same time. How do I open three separate connections to the databases?

    It depends on your database API. For example, with the PDO extension you would create a PDO object for each database connection. Likewise, with the MySQLi extension you would create a MySQLi object for each database connection. With the legacy MySQL extension you would have a different link identifier for each database connection.

    I have noticed that some threads mention ADODB. Is this faster than the traditional method in connecting to a MySQL database?

    No, it is an abstraction layer and thus may even result in slightly lower performance as a trade off.

      berbbrown wrote:

      I have three MySQL databases and I wish to connect to all three sometimes at the same time. How do I open three separate connections to the databases?

      Trivially. The same as you would one. Just make sure you specify a link_id if you're using the mysql_ functions.

      I have noticed that some threads mention ADODB. Is this faster than the traditional method in connecting to a MySQL database?

      No, it's just a wrapper which confers no advantage. In fact it would probably be slower (but not by enough that you care)

      Mark

        Write a Reply...