Delight Posted October 2, 2008 Share Posted October 2, 2008 I have a website on domain_A. I like to have it connect to a database witch is on domain_B (differend provider and differend url). Is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/126734-connect-to-database-on-other-domain/ Share on other sites More sharing options...
GregL83 Posted October 2, 2008 Share Posted October 2, 2008 Yes, provide the location of the mysql server (domainB) in your database connection function. i.e. $connection = mysql_connect('domain_location','username','password'); assuming your using php. Quote Link to comment https://forums.phpfreaks.com/topic/126734-connect-to-database-on-other-domain/#findComment-655578 Share on other sites More sharing options...
GregL83 Posted October 2, 2008 Share Posted October 2, 2008 http://us3.php.net/mysql_connect That should help... Quote Link to comment https://forums.phpfreaks.com/topic/126734-connect-to-database-on-other-domain/#findComment-655579 Share on other sites More sharing options...
Zane Posted October 2, 2008 Share Posted October 2, 2008 of course...that's the proper way of connecting and all... but on the mysql side of it all....you need to ALLOW domain A to connect.. or else you'll get an error saying something like error connection...using password YES are you using phpmyadmin or are you using the mysql shell to acces your database? Quote Link to comment https://forums.phpfreaks.com/topic/126734-connect-to-database-on-other-domain/#findComment-655584 Share on other sites More sharing options...
revraz Posted October 2, 2008 Share Posted October 2, 2008 Many Hosts do not allow outside access to the Database, you should really check with your Host first. Quote Link to comment https://forums.phpfreaks.com/topic/126734-connect-to-database-on-other-domain/#findComment-655587 Share on other sites More sharing options...
Delight Posted October 3, 2008 Author Share Posted October 3, 2008 Thanks all, I'll give this a try. To answer all the questions: I'm using php, phpmyadmin and mysql. Quote Link to comment https://forums.phpfreaks.com/topic/126734-connect-to-database-on-other-domain/#findComment-656173 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.