Re: DB multible db connections
| From: | Justin Patrin | Date: | Wed, 10 Dec 2003 19:45:44 +0000 |
| Subject: | Re: DB multible db connections | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9462@lists.php.net to get a copy of this message | ||
Philip Shafer wrote:
We're running PHP 4.1.2, with apache 1.3.26, and MySQL 3.23.41, running on a Redhat 7.3 server. I'm having a problem using persistent database connections. I'm trying to set up a number of database connections. All the databases are on the same server. If I set up N connections and I try to query from Connection 1, it attempts the query on database N, and it will return a DB_ERROR object usually stating that the 'table doesn't exists in the database'. This is a rather annoying bug, and I've yet to find a solution. IF I print_r() a connection resource, it will dump all of the objects properties and the database name is properly set. However, running a query will always run on the last connection made. I've run this with and without persistent connections and with to success have I had this to work. The only thing I can do is open a connection, query, dump results, close connection every time I want to use a different database. This is obviously not efficient. Can anybody help? Does PHP 4.3 solve this problem? By the way this is what's give by phpinfo(); mysql.allow_persistent On On mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited -phil ------------------ Philip Shafer Web Programmer Information Resources Rowan University 856-256-4418 shafer@rowan.eduAre you using the newest version of PEAR::DB? This works just fine for me with the newest PEAR::DB and PHP 4.3.3. It *may* be that PHP 4.3.3 fixes it, but I don't know for sure. Try searching the pear bug database. Could you show us some example code? -- paperCrane <Justin Patrin>