title: Automatic db connection close in php?
body: <p>I have following in my config.php file for one of my web app.</p>
  
  <pre><code>//db settings
      $host = 'localhost'; //database location
      $user = 'example'; //database username
      $pass = 'example12'; //database password
      $db_name = 'example'; //database name
  
  //create db connection
      $link = mysql_connect($host, $user, $pass);
      mysql_select_db($db_name);
  
  //sets encoding to utf8
      mysql_query("SET NAMES utf8");
  </code></pre>
  
  <p>I am including <code>config.php</code> in all pages of my application at top (1st line of code). </p>
  
  <p>I want to know that will PHP/MYSQL maintain connection open and close automatically or I need to explicitly call them. Connection is opening by itself, as I am doing all db based tasks properly. But not closing connection anywhere, this is a high traffic website.</p>
  
  <p>Please correct me if I am wrong anywhere.</p>
  
  <p>Thanks!</p>