Re: [PHP] Two MySQL connections in one script not working as expected

2005-09-28 Thread Robin Vickery
If you make two calls to mysql_connect with the same parameters, the second will not make a new connection - it will return the existing connection. The manual explains this: http://www.php.net/mysql_connect If a second call is made to mysql_connect() with the same arguments, no new link will

[PHP] Two MySQL connections in one script not working as expected

2005-09-27 Thread Charles Kline
Hi all, I have a script that needs to update data in two databases. My db connections are both in class files that I created to execute the various connections and queries. What is happening is that the second database connection does not seem to work. The error I get is that it seems

Re: [PHP] Two MySQL connections in one script not working as expected

2005-09-27 Thread Gustav Wiberg
- Original Message - From: Charles Kline [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, September 27, 2005 8:25 PM Subject: [PHP] Two MySQL connections in one script not working as expected Hi all, I have a script that needs to update data in two databases. My db

Re: [PHP] Two MySQL connections in one script not working as expected

2005-09-27 Thread Andy Pieters
Hi Without you actually showing us these class files we can only guess but a common mistake is this: mysql_open(connection details) mysql_query(query) In those cases the last opened handle is used. To prevent this, use this syntax $db1=mysql_open(connection for db1);

Re: [PHP] Two MySQL connections in one script not working as expected

2005-09-27 Thread Charles Kline
On Sep 27, 2005, at 3:42 PM, Andy Pieters wrote: Hi Without you actually showing us these class files we can only guess but a common mistake is this: mysql_open(connection details) mysql_query(query) In those cases the last opened handle is used. To prevent this, use this syntax

Re: [PHP] Two MySQL connections in one script not working as expected

2005-09-27 Thread M. Sokolewicz
Charles Kline wrote: On Sep 27, 2005, at 3:42 PM, Andy Pieters wrote: Hi Without you actually showing us these class files we can only guess but a common mistake is this: mysql_open(connection details) mysql_query(query) In those cases the last opened handle is used. To prevent this,

Re: [PHP] Two MySQL connections in one script not working as expected

2005-09-27 Thread Charles Kline
On Sep 27, 2005, at 5:23 PM, M. Sokolewicz wrote: Charles Kline wrote: On Sep 27, 2005, at 3:42 PM, Andy Pieters wrote: Hi Without you actually showing us these class files we can only guess but a common mistake is this: mysql_open(connection details) mysql_query(query) In those