Re: Multiple Database Connection Using Prepard Statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Bastien Koert

On 2012-05-19, at 2:36 PM, "Ron Piggott" <ron.piggott@xxxxxxxxxxxxxxxxxx> wrote:

> 
> How do I connect to multiple mySQL databases using Prepared Statements ?
> 
> I have the syntax
> 
> ===
> $dsh = 'mysql:host=localhost;dbname='.$database3; 
> $dbh = new PDO($dsh, $username, $password); 
> ===
> 
> I want to connect to $database1 without loosing my $database3 connection
> 
> Thoughts?  Comments?  
> 
> 
> Ron Piggott
> 
> 
> www.TheVerseOfTheDay.info 

Ron,

MySQL also supports the convention of using the database name in the query so that you don't necessarily need another connection manage

Select field1, field2 ... Fieldn from db2.table_name [where clause]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux