title: do i need to instanciate this class multiple times?
body: <p>When a user clicks a button, my script instantiates this class. so if there are fifty users on my website that click this button then there will be 50 of these classes that have been instantiated. is this the right thing to do? or do i need to check if this class has already been instantiated before and not do anything if it has been.</p>
  
  <p>I connect to my db here.
  there is more to this class, this is just a snippet.</p>
  
  <pre><code>class Database{
      private $host      = "localhost";
      private $user      = "rt";
      private $pass      = "";
      private $dbname    = "db";
  
      public function __construct(){
          // Set DSN
          $dsn = 'mysql:host=' . $this-&gt;host . ';dbname=' . $this-&gt;dbname;
          // Set options
          $options = array(
                  PDO::ATTR_PERSISTENT    =&gt; true,
                  PDO::ATTR_ERRMODE       =&gt; PDO::ERRMODE_EXCEPTION
          );
          // Create a new PDO instanace
          try{
              $this-&gt;dbh = new PDO($dsn, $this-&gt;user, $this-&gt;pass, $options);
          }
          // Catch any errors
          catch(PDOException $e){
              $this-&gt;error = $e-&gt;getMessage();
          }
      }
  }
  </code></pre>