error mysql_connect()

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
fredyfonda
Forum Newbie
Posts: 6
Joined: Tue Feb 28, 2006 1:54 am
Contact:

error mysql_connect()

Post by fredyfonda »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Please help me...

I don't know what happen, it never happened before on my other project.

One of my client web site when tried to login it show error at mysql_connect();
The error said there are too many connection.

Here some of my code :

Code: Select all

//file -> dbConnection.php
<?php
          $user          =   "acarak01_123";
          $password =  "123";
          $nameDB    = "mwga_acaraku";

          $con = mysql_connect('localhost',$user,$password);
          if(!($con))
          { exit(); }
          else
          {  mysql_select_db($nameDB);  }
?>
Is there any other way to catch the error without show the error on the web page?
If it must validate, where must I put my validation?

Thanks for every one that can help me...


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

fredyfonda wrote:The error said there are too many connection.
There's a search engine for the mysql manual at http://www.mysql.com/search/index.php

too many connections as search term gets you e.g.
http://dev.mysql.com/doc/refman/5.0/en/too-many-connections.html wrote:If you get a Too many connections error when you try to connect to the mysqld server, this means that all available connections are in use by other clients.

The number of [...]
fredyfonda
Forum Newbie
Posts: 6
Joined: Tue Feb 28, 2006 1:54 am
Contact:

Thanks :)

Post by fredyfonda »

Thanks Volka for the answer.
It really help me very much :D
Post Reply