title: PDO simple select query using oracle database
body: <p>i want to try to run simple select query to know if the database connection is working fully.</p>
  
  <p>Here is some coding i have done on php file and tried to execute it.</p>
  
  <pre><code>$tns = "
  (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = COD3R-PC)(PORT = 1521))
      )
      (CONNECT_DATA =
        (SERVICE_NAME = XE)
      )
    )
         ";
  try {
      $conn = new PDO("oci:dbname=".$tns, '****', '****');
      $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      echo 'Connected to database';
  } catch(PDOException $e) {
      echo 'ERROR: ' . $e-&gt;getMessage();
  }
  /*if($_POST['searchFilter']){
      $searchFilter = $_POST['searchFilter'];
      $stmt = $conn-&gt;prepare("SELECT ROOM, GUEST_NAME FROM RESERVATION_GENERAL_2 WHERE ROOM LIKE ? OR GUEST_NAME LIKE ?");
      $stmt-&gt;execute(array('%'.$searchFilter.'%','%'.$searchFilter.'%' ));
      $results = $stmt-&gt;fetchAll(PDO::FETCH_ASSOC);
      $stmt-&gt;closeCursor();
      if (empty($results)){
        print_r(json_encode(0));
      }
      else{
      print_r(json_encode($results));
      }
  }*/
  $stmt = $conn-&gt;prepare("SELECT * FROM RESERVATION_GENERAL_2");
  $stmt-&gt;execute(array($stmt));
  $results = $stmt-&gt;fetchAll(PDO::FETCH_ASSOC);
  $stmt-&gt;closeCursor();
  </code></pre>
  
  <p>The only message i got is <code>Connected to database</code>.
  I am not sure if it is really connected to database or not, cuz i dont know about try and catch much.
  and after that there is a blank page no result.</p>
  
  <p>Please see the screenshot for the table name and columns.
  <img src="https://i.stack.imgur.com/98Z1A.jpg" alt="enter image description here"></p>
  
  <p>what am i doing wrong please tell.</p>