jjmusicpro Posted December 13, 2007 Share Posted December 13, 2007 i was curious, how i connect using a url to a db, and not saying "localhost" here is my connection files, that in use the include feature on my other pages... connect.php <?php // This is an example of config.php $dbhost = 'localhost'; $dbuser = 'xxxxx'; $dbpass = 'joxxxx'; $dbname = 'xxxx'; ?> would i just change the DBHOST to the URL? Link to comment https://forums.phpfreaks.com/topic/81554-solved-how-to-connec-to-a-db-via-url-and-not-localhost/ Share on other sites More sharing options...
paul2463 Posted December 13, 2007 Share Posted December 13, 2007 yes, either the ip address or the name of the DB server Link to comment https://forums.phpfreaks.com/topic/81554-solved-how-to-connec-to-a-db-via-url-and-not-localhost/#findComment-414097 Share on other sites More sharing options...
jjmusicpro Posted December 13, 2007 Author Share Posted December 13, 2007 for some reason that doesnt work for me.. page just times out. Link to comment https://forums.phpfreaks.com/topic/81554-solved-how-to-connec-to-a-db-via-url-and-not-localhost/#findComment-414102 Share on other sites More sharing options...
PFMaBiSmAd Posted December 13, 2007 Share Posted December 13, 2007 Does your mysql_connect() function call have any error checking to get it to tell you why it failed? You will need to provide more information about what your code is and what you are doing for anyone in a forum to be able to help. Link to comment https://forums.phpfreaks.com/topic/81554-solved-how-to-connec-to-a-db-via-url-and-not-localhost/#findComment-414124 Share on other sites More sharing options...
PHP_PhREEEk Posted December 13, 2007 Share Posted December 13, 2007 You also need to add a MySQL user for the remote connection. Post on the MySQL board for help setting this up. If you are on a shared server, this most likely has been locked down. PhREEEk Link to comment https://forums.phpfreaks.com/topic/81554-solved-how-to-connec-to-a-db-via-url-and-not-localhost/#findComment-414180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.