Welcome Guest, Not a member yet? Register   Sign In
mysql multiple connections can use same pconnect causing grief.
#1

[eluser]Skotos[/eluser]
Take the following code:
$alphaDB = $this->load->database('alpha', TRUE);
$betaDB = $this->load->database('beta', TRUE);

echo "alpha using: ".mysql_result(mysql_query("SELECT DATABASE()",$alphaDB->conn_id),0)."<br>\n";
echo "beta using: ".mysql_result(mysql_query("SELECT DATABASE()",$betaDB->conn_id),0)."<br>\n";

$alphaDB->select('id, description');
$q = $alphaDB->get('male'); // Select the `male` table from `alpha` schema.
---
If both alpha and beta databases use the same host, same username and same password, then the script errors:

alpha using: beta
beta using: beta
Quote:A Database Error Occurred

Error Number: 1146

Table 'beta.male' doesn't exist

SELECT `id`, `description` FROM (`male`)
---
Synopsis:
Maybe it's a bug, or maybe it needs to be documented in the Multiple Database Section of the User Guide that connections need to differ in at least host or authentication credentials, (so that different connections are formed.)


Messages In This Thread
mysql multiple connections can use same pconnect causing grief. - by El Forum - 10-30-2008, 05:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB