title: Getting a 'Class PDO not found' error
body: <p>I have a simple 'Coming Soon' page on which I take subscribing emails which I intend to insert into a mysql database.</p>
  
  <p>I had the code running before, but now coming back to it 1-2 weeks later, there seem to be some problems.</p>
  
  <p>Basically there are only 2 files involved: <code>index.html</code> and <code>subscribe.php</code>. <code>index.html</code> is the actually 'Coming Soon' page, and it calls <code>subscribe.php</code> to actually insert the email into database, provided its a valid email, is not a duplicate, etc ..</p>
  
  <p>The code for <code>subscribe.php</code> is given below. Its a very simple code really.</p>
  
  <p>Do not that this WAS working before ! However now there seems to be a 'Class PDO not found ...' error coming at the line where PDO is being used:</p>
  
  <pre><code>&lt;?php
  
  function isValidEmail( $email = null )
  {
      return preg_match( "/^
      [\d\w\/+!=#|$?%{^&amp;}*`'~-]
      [\d\w\/\.+!=#|$?%{^&amp;}*`'~-]*@
      [A-Z0-9]
      [A-Z0-9.-]{0,61}
      [A-Z0-9]\.
      [A-Z]{2,6}$/ix", $email );
  }
  
  try {
      // Connect to the SQLite Database.
      $db = new PDO('mysql:host=hostnamehere;dbname=dbnamehere', 'usernamehere', 'passwordhere');
  } catch(Exception $e) {
      die('connection_unsuccessful');
  }
  
  /* Check if table exists */
  $db-&gt;exec('CREATE TABLE IF NOT EXISTS subscribers (email VARCHAR(255), time VARCHAR(255))');
  
  /* Check if email has been posted */
  if ( isset($_POST['email']) ) {
  
      /* Validate email */
      if ( isValidEmail($_POST['email']) ) {
  
          /* Check for duplication */
          $query = $db-&gt;prepare('SELECT COUNT(*) AS count FROM subscribers WHERE email = :email');  
          $query-&gt;execute(array(':email' =&gt; $_POST['email']));
          $result = $query-&gt;fetch();
  
          if ( $result['count'] == 0 ) { // E-mail is unique.
  
              $query = $db-&gt;prepare('INSERT INTO subscribers (email, time) VALUES (:email, :time)');  
              $query-&gt;execute(array('email' =&gt; $_POST['email'], 'time' =&gt; date('Y-m-d H:i:s')));
  
              /* Send mail notification */
              $to = 'newsubscriber@xyz.com'; // Email notified of the new subscription
              $subject = 'New subscriber';
              $message = 'Hi, you have one new subscriber. This is his/her e-mail address: ' . $_POST['email'] . '.';
              $headers = "From:" . $_POST['email'];
              mail($to,$subject,$message,$headers);
  
              echo 'successful';
  
          } else { // E-mail is already being used.
              echo 'already_subscribed';
          }
  
      } else {
          echo 'invalid_email';
      }
  
  }
  </code></pre>