I\'ve seen a few errors like this, but I found no answer.
Unable to connect to database: Access denied for user \'\'@\'localhost\' to database \'socialdb\'
The error is pretty self-explanatory, you're not allowed to connect without specifying some credentials.
Change your call to mysql_connect() to something like this:
mysql_connect("localhost", "user", "password");