Prepared Statements With Multiple Databases
| From: | Ron Piggott | Date: | Sat, 01 Oct 2011 00:26:08 +0000 |
| Subject: | Prepared Statements With Multiple Databases | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-48015@lists.php.net to get a copy of this message | ||
I need my Prepared Statement database connection to be able to connect with two different databases
(which use the same username / password).
They are assigned variables
$database1 and $database2
What I have been using so far is:
$dsh = 'mysql:host=localhost;dbname='. $database1;
$dbh = new PDO($dsh, $username, $password);
Is there a way to amend this with a second database connection?
Ron
www.TheVerseOfTheDay.info