MySQL Forums
Forum List  »  PHP

mysqli Connection Errors in PHP
Posted by: Frank Sellers
Date: August 16, 2005 02:58PM


I have some php code in which I am query records out of the database. I can run it and it works fine. But I have noticed that whenever I run it multiple times in a short period of time that I am receiving the following error message:

Can't connect to MySQL server on 'localhost' (10048)
The Error Number returned is 2003

Here is the code that I am using in PHP:
$this->link = new mysqli(localhost, $user, $password, $DB);

if (mysqli_connect_errno())
printf("Connect failed: %s\n", mysqli_connect_error());
echo "Error Number: " . mysqli_connect_errno() . "<br>";

I am always connecting throught the localhost, and it always uses the same username and password to access the database. It will run through a couple of times, and then I will start receiving the error message stated above. My initial thought is that I have too many connections open at the same time. I looked in my php.ini file and the max connections is set to -1, which is unlimited. Anyone else have any other ideas?



Options: ReplyQuote

Written By
mysqli Connection Errors in PHP
August 16, 2005 02:58PM

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.