1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Too many sessions open = 'max_user_connections' active connections

Discussion in 'PHP' started by ridesign, Mar 30, 2007.

  1. #1
    Hi,
    On my site I have told by my host that too many session are remaining opne and I get the below error in the error log file:

    mysql_pconnect() [<a href='function.mysql-pconnect'>function.mysql-pconnect</a>]: User a_db has already more than 'max_user_connections' active connections in /home/dir/public_html/l/adodb/adodb-mysql.inc.php on line 85

    I have checked that file and it has the following code is the below okay?:
    // returns true or false
    function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
    {
    $this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);
    if ($this->_connectionID === false) return false;
    if ($argDatabasename) return $this->SelectDB($argDatabasename);
    return true; 
    }
    
    // returns true or false
    function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)
    {
    $this->_connectionID = mysql_pconnect($argHostname,$argUsername,$argPassword);
    if ($this->_connectionID === false) return false;
    if ($argDatabasename) return $this->SelectDB($argDatabasename);
    return true; 
    }
    PHP:
    Also I have checked the normal php files and they have :
    session_start();
    in the beginning but no "session_write_close();"

    Do I need to add this at the end of each file?
     
    ridesign, Mar 30, 2007 IP