-Why am i getting this message: "PHPLens and Sessions are using the same connection, but they are connected to different databases. Please change PHPLens userid or session userid to force different connections" ?I've included a new array in config/phplens.config.inc.php
'db3' => array('mysql','localhost','root','password','db3')
Here is the message I get:
PHPLens and Sessions are using the same connection, but they are connected to different databases.
Please change PHPLens userid or session userid to force different
connections.
I quote from the php manual:
http://php.net/manual/en/function.mysql-connect.php
If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned.
Also note that mysql_connect() does not connect you to the database. You have to call mysql_select_db().
So phplens will connect to mysql to get at the internal "phplens" table like this:
$conn1 = mysql_connect($host, 'root','password');
mysql_select_db($conn1, $db1);
Then your db3 code will connect with the following code:
$conn3 = mysql_connect($host3, 'root','password');
mysql_select_db($conn2,$db3);
Now my internal phpLens $conn1 is pointing to the same connection as your $conn3, but to the wrong database ($db3 when it should be $db1). This screws phplens up real bad.
The fix is to add a new user to your mysql database, and set
'db3' => array('mysql','localhost','root2','password2','db3')
Also see: http://phplens.com/lens/lensforum/msgs.php?id=561
800