siddscool19 Posted October 9, 2008 Share Posted October 9, 2008 How to access database on another server? What codings should i use? Quote Link to comment Share on other sites More sharing options...
trq Posted October 9, 2008 Share Posted October 9, 2008 Pass the host to the host argument of mysql_connect(). Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted October 9, 2008 Share Posted October 9, 2008 just use their host/username/password in your mysql_connect() statement. if they have it firewalled where you can only connect internally, you really can't. Quote Link to comment Share on other sites More sharing options...
siddscool19 Posted October 9, 2008 Author Share Posted October 9, 2008 I own it myself just the thing is that i want to access my database from another site Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted October 9, 2008 Share Posted October 9, 2008 then, as we've said, use the host address in your mysql_connect(). Quote Link to comment Share on other sites More sharing options...
siddscool19 Posted October 9, 2008 Author Share Posted October 9, 2008 for example my database name is hi_name Username is hi_user Pass is hipass Then how to access database if my database is on http://hii.com I mean can u explain me by this example? Quote Link to comment Share on other sites More sharing options...
trq Posted October 9, 2008 Share Posted October 9, 2008 mysql_connect('http://hii.com','hi_user','hipass'); You'll also need to make sure mysql allows you to connect from your remote domain. eg; GRANT ALL PRIVILEGES ON *.* TO 'hi_name'@'DOMAIN_YOUR_CONNECTING_FROM' IDENTIFIED BY 'hipass' WITH GRANT OPTION; Quote Link to comment 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.