An error has occurred connecting to the database

SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Fatal error: Call to a member function prepare() on a non-object in E:\htdocs\\index.php on line 14