Rifts Posted March 14, 2010 Share Posted March 14, 2010 Hey everyone I tried to search for this answer but i'm fairly new I honestly have no idea what to do. I'm trying to create a facebook application. here is some background on the setup. using godaddy to host my app. with php 5.X and Mysql here my is connect code: $username="xxxxxx"; $password="xxxxxx"; $database="xxxxxx"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); Yes im 100% sure the username/password are correct. and I tired both localhost and 'localhost' still didnt work anyway this is the error im getting when i refresh the page: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/r/h/e/rh/html/fb/php/config.php on line 19 Unable to select database Thanks for the help Link to comment https://forums.phpfreaks.com/topic/195233-facebook-application-mysql-connect-help/ Share on other sites More sharing options...
StathisG Posted March 14, 2010 Share Posted March 14, 2010 Ask your host (godaddy) as well. Although 'localhost' is the most common option for the server, some hosts use different settings. Link to comment https://forums.phpfreaks.com/topic/195233-facebook-application-mysql-connect-help/#findComment-1026073 Share on other sites More sharing options...
Rifts Posted March 14, 2010 Author Share Posted March 14, 2010 figured it out.... i guess you cant use localhost at all i had to use the FULL path to my database something like name.db.55247147.hostedresource.com Link to comment https://forums.phpfreaks.com/topic/195233-facebook-application-mysql-connect-help/#findComment-1026080 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.