I'm having an error connecting to the database for the admin section of my website and I think it relates to this topic. It's weird because I'm able to connect to the database for every other section of the site. Here is the error when I try to log in to the admin section: Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /data/16/1/57/83/1546246/user/1664829/htdocs/admin/functions.php on line 6 Database connectivity Error The function in question (line 6 is the if statement): function dbcon(){ global $host, $user, $pass, $db,$link; if(!($link=mysql_connect($host,$user,$pass) && mysql_select_db($db))) { sprintf("Internal error %d %s",mysql_errno(),mysql_error()); return 0; } else { return 1; } } Everything works fine in PHP4, its when I switched to PHP5 that I started getting errors. Any idea whats wrong?