Author Topic: Facebook Application mysql connect help  (Read 348 times)

0 Members and 1 Guest are viewing this topic.

Offline RiftsTopic starter

  • Devotee
  • Posts: 612
  • Gender: Male
    • View Profile
Facebook Application mysql connect help
« on: March 14, 2010, 06:57:25 PM »
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:
Code: [Select]
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

Offline StathisG

  • Irregular
  • Posts: 24
  • Gender: Male
    • View Profile
    • Portfolio
Re: Facebook Application mysql connect help
« Reply #1 on: March 14, 2010, 07:09:53 PM »
Ask your host (godaddy) as well. Although 'localhost' is the most common option for the server, some hosts use different settings.

Offline RiftsTopic starter

  • Devotee
  • Posts: 612
  • Gender: Male
    • View Profile
Re: Facebook Application mysql connect help
« Reply #2 on: March 14, 2010, 07:26:11 PM »
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