Jump to content

A connection attempt failed


squiblo

Recommended Posts

All my web pages connect to MySQL before the html tag by including a php file like so...

 

<?php
session_start();
require_once "php/connections/dbconnect.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="#top">
<head>

 

All pages connect successfully apart from one, that does not manage to connect about 1 in 5 times. This is the error that I am getting...

 

Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connecti (trying to connect via tcp://46.183.8.87:3306) in C:\xampp\htdocs\socialnews\php\connections\dbconnect.php on line 3

 

Warning: mysql_connect() [function.mysql-connect]: 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. in C:\xampp\htdocs\socialnews\php\connections\dbconnect.php on line 3

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.

 

And this is the contents on the dbconnect.php...

 

<?php
//CONNECT TO DATABASE
$connect = mysql_connect("*****", "*****", "*****") or die(mysql_error());
$db = mysql_select_db("*****", $connect) or die(mysql_error());
?>

 

I have no idea where to start looking because it's such a strange problem. Any idea of what I need to check? Any tips will be appreciated!

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.