title: Why is the server rejecting my PDO query?
body: <p>I've been trying to write a simple search and display site with a drop down menu, I've tried using mysqli and PDO and I'm not getting the results. I've just checked the server log in cpanel and found that the access has been denied to the results page. The access must be all right for the drop down page as it is populating the drop down list. I can't see why it is being stopped. The server is running PHP 5.3.27 and MYSQL 5.5.36.</p>
  
  <p>This is the drop down.</p>
  
  <pre><code> &lt;form action="search3.php" method="post" &gt;
  
  &lt;?php
  
      $mysqli = new mysqli('localhost','user','password','engraved_stamps');
      if ($mysqli-&gt;connect_error) {
      die('Error : ('. $mysqli-&gt;connect_errno .') '. $mysqli-&gt;connect_error);
      }
  
      $query = "SELECT DISTINCT Country FROM engravers ORDER BY Country";
      $result = $mysqli-&gt;query($query);
  
      ?&gt;
      &lt;select &gt;
      &lt;?php
  
         while ($row = $result-&gt;fetch_assoc()) {
           echo "&lt;option value=\"{$row['Country']}\"&gt;";
           echo $row['Country'];
           echo "&lt;/option&gt;";
      }
      $mysqli-&gt;close();
      ?&gt;
        &lt;/select&gt;
  
                &lt;input type="submit" name="dropdown" /&gt;   
                &lt;/form&gt;
  </code></pre>
  
  <p>This is the results page (action for restul) (called Search3.php)</p>
  
  <pre><code>    &lt;?php
  
      $hostname = "localhost";
      $user = "user";
      $password = "password";
      $connection = mysqli_connect($hostname, $user, $password,);
      if(!$connection){
      echo"Could not connect to server";
      };
      mysqli_select_db($connection,'engraved_stamps');
      if(!mysqli_select_db($connection,'engraved_stamps')){
      echo"could not connect to database";
      };
  
      if(isset($_POST['dropdown'])){
      $Country = $_POST['dropdown'];
      }else{
      $Country = "none";
      }
      $sql= "SELECT * FROM engravers WHERE Country = :Country";
      $stmt = $pdo-&gt;prepare($sql);
      $stmt-&gt;bindParam(':Country', $Country, PDO::PARAM_STR);
      $stmt-&gt;execute();
      $total = $stmt-&gt;rowCount();
  
      while ($row = $stmt-&gt;fetchObject()) {
      echo $row-&gt;Country;
      }
  
      $mysqli-&gt;close();
  
          ?&gt;
  </code></pre>