Jump to content


Photo

Can you connect to two mysql databases at the same time?


  • Please log in to reply
2 replies to this topic

#1 dragonusthei

dragonusthei
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 17 October 2006 - 10:26 PM

Can you connect to two mysql databases at the same time?

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 17 October 2006 - 10:42 PM

yes - just use two (or even more) handles for each DB you're connecting to.

$first_db = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$second_db = mysql_connect('localhost', 'mysql_user2', 'mysql_password2');

and use them as normal.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 dragonusthei

dragonusthei
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 17 October 2006 - 10:56 PM

Thank you :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users