RE: [PHP-DB] Losing MySQL connection with multiple database classes
| From: | Mika Porspakka | Date: | Wed, 05 May 2004 11:26:19 +0000 |
| Subject: | RE: [PHP-DB] Losing MySQL connection with multiple database classes | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34273@lists.php.net to get a copy of this message | ||
Oh damn.
The class was missing the link identifier in one of the functions and that reset the rest of the class instances too.
Thanks, probably would have taken hours before i had taken a look at the class..
Check your class... Maybe it resets the connection each time you create it. -----Original Message----- From: Mika Porspakka [mailto:mika.porspakka@nextime.fi] Sent: Wednesday, May 05, 2004 12:23 To: php-db@lists.php.net Subject: [PHP-DB] Losing MySQL connection with multiple database classes Hello all. I'm getting a weird problem trying to use a database class for multiple connections for different databases on the same server. Whenever I make a new instance of the class, all the previously opened class instances connect to that new MySQL database. So, for example, if I have something like..: -8<----- $dbcon1 = new databaseclass($server1,$user1,$pass1,$database1); $dbcon1->connect(); $dbcon1->query($sql); $dbcon2 = new databaseclass($server2,$user2,$pass2,$database2); $dbcon2->connect(); $dbcon2->query($another_sql); $dbcon1->query($yet_another_sql); -8<----- the last query doesn't work since $dbcon1 seems to point now to the same database as $dbcon2, and by all that I have read this shouldn't be happening... should it? Please, help is appreciated very much. -Mika Porspakka -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php