So I'm running what should be the simplest possible script, just using mysql_real_escape_string to escape out any dangerous characters before submitting my query, and for whatever reason I keep getting the same kind of error.
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
in /homepages/8/d126361012/htdocs/searchgames.php on line 33
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]:
A link to the server could not be established in
/homepages/8/d126361012/htdocs/searchgames.php on line 33
The code by the way, is simply
$submit = $_POST['submit'];
$keywords = addcslashes(mysql_real_escape_string($_POST['keyword']), '%_');
$console = addcslashes(mysql_real_escape_string($_POST['console']), '%_');
I can't imagine that there's anything wrong with that, so it has to be something with my PHP configuration. However, a similar code runs just fine in a different directory. Can anyone give me an idea of what that error message means?