Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2013
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to handle this sutiation

    I developed one web application (http://thequotes.net/quotes/facebookcover/) using php and mysql. Now this application are used by some user(approx 10user) daily.Unexpectedly it shows warning like "Too many connections(mysql_connect())" in config.php. so how to handle this sutiation.
    Last edited by VIPStephan; 06-29-2013 at 10:58 AM. Reason: removed link

  • #2
    Regular Coder
    Join Date
    Nov 2010
    Location
    Oregon
    Posts
    243
    Thanks
    23
    Thanked 10 Times in 10 Posts
    make sure each user has his own unique session, and use the include connect in each page header.

    PHP Code:
    require_once("includes/connect_session.php"); 
    PHP Code:
        // MySQL connect information.
        
    $db_username "DatabaseLoginName";
        
    $db_password "DatabaseLoginPassword";
        
    $db_host       "address_to_hosting_connection";
                       
        
    $db_database "DatabaseName";

    // Connect.
        
    $db_connection mysql_connect($db_host$db_username$db_password)
        or die (
    "Server Is Busy Try Again Later - Send user to a default webpage");

        
    mysql_select_db($db_database)
        or die (
    "Server Is Busy Try Again Later - Send user to a default webpage"); 
    Last edited by DataTalk; 06-22-2013 at 07:19 AM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •