SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) Notice: Undefined variable: db in /var/www/html/index.php on line 8 Fatal error: Call to a member function query() on a non-object in /var/www/html/index.php on line 8