I've been looking for a solution on various forums for hours...
I keep getting this error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
the script that I'm using is
The username and password are correct when I use them to log into phpMyAdmin. I've been looking at forums and people are saying to change the socket, but how do I go about doing that? I can see that PHP is attempting to connect via tmp/mysql.sock when I checked MySQL variables it says that the socket directory is /var/run/mysqld/mysqld.sock. How would I either change the socket directory in my script or change the directory in my mysql config file?PHP Code:
$connection = mysql_connect('localhost','username','password') or die ("<p class = 'error'>Sorry, we were unable to connect to the database server.</p>");
The company I'm working for is using NetworkSolutions as their hosting server if that makes any difference.
any help or advice would be great.