I know I have the correct information to login to the MySQL database on my site. I am getting an error that states:
Can’t connect to local MySQL server through socket ‘/tmp/mysqld.sock’ (2)
The login information is all in the same config file that is included in every page that needs to access the database.
I am ending on the last line below, with this error.
echo "<h2> {$_SESSION['first_name']} - you're logged in.</h2>";
if (isset($_POST['submitted'])) { /* Handle the form */
$query = "SELECT email, user_id FROM users_tbl WHERE first_name = '$_SESSION[first_name]'";
echo $query;
$result = mysql_query ($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
When I login, I create the session and when get to this page, it displays “Bill you’re logged in.” showing that I have the correct first_name.
What should I do to determine the cause of this error?