title: PHP, Oracle and ODBC: How to check if result set is empty?
body: <p>Dear nerds and forumianers,</p>
  
  <p>I have a delicious problem with PHP on a Oracle database with ODBC driver.</p>
  
  <p>First the code:</p>
  
  <pre><code>$ora_conn = odbc_connect($ora_dsn, $ora_user, $ora_pass, SQL_CUR_USE_ODBC);
  $ora_data = odbc_exec($ora_conn,$sql);
  
  //echo "test: ".odbc_num_rows( $ora_data );
  //exit;
  
  if(odbc_num_rows( $ora_data ) &gt; 0){
      // do something in case no result came back
  }
  
  if($ora_data){
      // do something in case result came back
  }
  </code></pre>
  
  <p>If I uncomment the test, I always get back -1! No matter if the statement results in 0, 1 or 5 rows...</p>
  
  <p>So with this code I never can get the information if there is no result, 1 result or more results coming back.</p>
  
  <p>Do you have any idea on how to solve this issue?</p>
  
  <p>Thank you very very much in advance for your help!</p>
  
  <p>Best regards, Ingmar</p>