title: How to get number of rows in php oci for SELECT statement
body: <p>I require help to get number of rows from select statement which contain where clause. I have tried various option. But it didn't work for me. I have shown my code snippet below.</p>
  
  <p>I'm getting o/p "0 rows fetched". But when I executed select query on Oracle DB, then it returns 1 row.</p>
  
  <p>Hence, please help me to get number of select statement in PHP through OCI.</p>
  
  <p>Environment:</p>
  
  <ul>
  <li>Windows, Php 7.3 and Oracle 12c     </li>
  </ul>
  
  <p>Here is the Oracle query</p>
  
  <pre><code>CREATE TABLE users 
  (
      no            INTEGER NOT NULL,
      id            VARCHAR2(200) NOT NULL,
      fullname      VARCHAR2(200),
      email         VARCHAR2(200),
      givenname     VARCHAR2(200),
      first_login   VARCHAR2(200),
      last_login    VARCHAR2(200)
  );
  
  INSERT INTO USERS (no, id,fullname,email,givenname,first_login,last_login) 
  VALUES (1,'Bharat','Bharat','Bharat@gmail.com','Bharat','2019-08-20 03:08:42','2019-08-20 03:08:42');
  
  INSERT INTO USERS (no, id,fullname,email,givenname,first_login,last_login) 
  VALUES (1,'bharat','bharat','bharat@gmail.com','bharat','2019-08-20 03:08:42','2019-08-20 03:08:42');
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>    &lt;?php
      # connect localhost oracle
      $conn = oci_connect('c##admin', 'ibm123', '127.0.0.1/XE');
      $res="array"; #array to staore oci_fetch_all o/p
      #thow error if unable to make connection
      if (!$conn) {
          $m = oci_error();
          trigger_error(htmlentities($m['message']), E_USER_ERROR);
      }
      # Parse oracle query
      $stid = oci_parse($conn, "select * from users where ID='Bharat'");
      # execute statement
      oci_execute($stid);
      # fetch all content
      $nrows = oci_fetch_all($stid, $res);
      echo "$nrows rows fetched&lt;br&gt;\n";
      # Dump content
      var_dump($res);
      $numrows = oci_fetch_array($stid, OCI_BOTH);
      echo oci_num_rows($stid) . " rows.&lt;br /&gt;\n";
      print_r($numrows);
      oci_free_statement($stid);
      oci_close($conn);
  ?&gt;
  </code></pre>
  
  <p>Here is the output. Expected output is 1 row fetched.</p>
  
  <pre><code>0 rows fetched
  </code></pre>
  
  <p>Please help me to fix this issue</p>