wookie Posted January 16, 2008 Share Posted January 16, 2008 I've got a forum and gallery software each with their own mysql database on the same host. If I want to call info from the galleries database to be used in the forum, from within the forum itself, how would I do this? Do I need to specify database user and pass similar to this: $dbuser="####"; $dbpass="####"; $dbname="####"; $chandle = mysql_connect("localhost", $dbuser, $dbpass) or die("Connection Failure to Database"); Or is there a simpler way to achieve this? Many thanks Wookie. Quote Link to comment https://forums.phpfreaks.com/topic/86291-solved-calling-from-one-database-to-another/ Share on other sites More sharing options...
trq Posted January 16, 2008 Share Posted January 16, 2008 No, you just need to use mysql_select_db to switch between the different databases using the same connection. Quote Link to comment https://forums.phpfreaks.com/topic/86291-solved-calling-from-one-database-to-another/#findComment-440820 Share on other sites More sharing options...
wookie Posted January 16, 2008 Author Share Posted January 16, 2008 Gotcha...thanks a lot. I thought it would be something simple. Wookie. Quote Link to comment https://forums.phpfreaks.com/topic/86291-solved-calling-from-one-database-to-another/#findComment-440828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.