Connect to Multiple Databases

3 posts by 2 authors in: Forums > CMS Builder
Last Post: February 15, 2013   (RSS)

Hello, All -

I'm putting together a picture gallery for a site which uses a feed from Facebook. Everything works nicely. The only problem is I want to store the photo information in a separate database (on the same host.).

I know that it is possible to connect to two databases at the same time - as outlined in the answer to this post:

http://stackoverflow.com/questions/274892/how-do-you-connect-to-multiple-mysql-databases-on-a-single-webpage

However, despite a great deal of effort, I've been unable to make it work.

Is there a simple way?

Thanks

Perchpole

Hi Greg -

Thanks for this. I'd worked out most of the code but I hadn't realised I needed:

mysql_close($dbhandle);
connectToMySQL();

That made all the difference!

:0)

Perch