title: How do I check if PHP is connected to a database already?
body: <p>Basically in pseudo code I'm looking for something like</p>
  
  <pre><code>if (connected_to_any_database()) {
      // do nothing
  }
  else {
      mysql_connect(...)
  }
  </code></pre>
  
  <p>How do I implement</p>
  
  <pre><code>connected_to_any_database()
  </code></pre>