Skip navigation links

MySQL Forums :: PHP :: Can't connect to MySQL server on 'localhost' (10048)


Advanced Search

Can't connect to MySQL server on 'localhost' (10048)
Posted by: Daniel banaan ()
Date: October 17, 2007 09:24AM

Hello,

Could someone help me with the following problem:

I have an application running in PHP & MySQL, and it works great but after a while I get the error 'Can't connect to MySQL server on 'localhost' (10048). I understand that the connection is lost, but everytime this is only for a short moment. After a while I press F5 and the 'website' continues. It is running on a local development environment (PHPdev and other computer Wamp).

Is it a common problem? Is it a sort of time-out, caused by something I don't know?

The error occurs most when I post a form, which inserts a row to a table in my database, but I don't understand why .... The part below is the post-part of my script..

$datum=$_POST['datum'];
$leverancier_id=$_POST['leverancier'];
$inkooporder_id=$_POST['inkooporder'];
$dagnummer=$_POST['dagnummer'];
$maandnummer=$_POST['maandnummer'];
$jaarnummer=$_POST['jaarnummer'];
$datum='' . $jaarnummer . '-' . $maandnummer . '-' . $dagnummer . '';
$kenteken=$_POST['kenteken'];
$chauffeur=$_POST['chauffeur'];

$mysql_id=mysql_connect("$dbhost","$dbuser","$dbpass"); //Coming from an include at the top of the page
$sql="INSERT INTO opslag VALUES ('', '$partij', '$kistnr', '$datum', '', '$celnr', '$bnnr', '$rijnr', '$laagnr','')";
mysql_db_query("$db","$sql",$mysql_id) or die ("lukt niet");
mysql_close($mysql_id);
echo '<script>location.href="index.php?sub=13&celnr='.$celnr.'"</script>';
exit;

Options: ReplyQuote


Subject Written By Posted
Can't connect to MySQL server on 'localhost' (10048) Daniel banaan 10/17/2007 09:24AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.