title: The active result for the query contains no fields
body: <p>I am getting the following error: <code>The active result for the query contains no fields</code></p>
  
  <p>Below is my code</p>
  
  <pre><code>&lt;?php
  session_start();
  include 'dbconnect_three.php';
  include 'dbconnect.php';
  include 'dbconnect_two.php';
  
  $uname      = $_SESSION['user'];
  $email      = $_SESSION['email'];
  $message_id = $_POST['mess_id'];
  $maxseq     = $_POST['maxseq'];
  $otheruser  = $_POST['otheruser'];
  
  //The part below is the one that does the query to retrieve the messages from the database
  
  $sql_message_retriver         = "SELECT message FROM inbox WHERE message_id='$message_id' ";
  $sql_message_retriever_result = sqlsrv_query($conn_three, $sql_message_retriever);
  
  
  while ($sql_message_result_display = SQLSRV_FETCH_ARRAY($sql_message_retriever_result, SQLSRV_FETCH_ASSOC)) {
      $message_string = $sql_message_result_display['message'];
      echo "&lt;right&gt;$message_string&lt;/right&gt;";
  }
  
  $seen   = 2;
  $maxseq = $maxseq + 1;
  
  echo "&lt;form action=// method=post&gt;";
  echo "Messageinput type=text name=update&gt;";
  echo "&lt;input type=hidden name=message_id value=$message_id&gt;"; // gotta fix this part
  echo "&lt;input type=hidden name=maxseq value=$maxseq&gt;";
  echo "&lt;input type=hidden name=otheruser value=$otheruser&gt;";
  echo "&lt;input type=hidden name=otheremail value=$otheremail&gt;";
  echo "&lt;input type=hidden name=keyes value=$keyes&gt;";
  echo "&lt;input type=submit name=submit value=Reply&gt;";
  echo "&lt;/form&gt;";
  
  print_r(sqlsrv_errors());
  
  ?&gt;
  </code></pre>
  
  <p>The exact error I get:</p>
  
  <pre><code>Array (
      [0] =&gt; Array (
          [0] =&gt; IMSSP
          [SQLSTATE] =&gt; IMSSP
          [1] =&gt; -28
          [code] =&gt; -28
          [2] =&gt; The active result for the query contains no fields.
          [message] =&gt; The active result for the query contains no fields.
      )
  )
  </code></pre>
  
  <p>Here is one suggestion i found to solve the problem from other forums: use the <code>sqlsrv_next_result</code>. I used it and it says ODBC function sequence error(something like that). </p>
  
  <p>Here is something else to note, when i change my sql statement to say like this:</p>
  
  <pre><code>$sql_id_two="SELECT message 
               FROM   inbox 
               WHERE  message_id = '$message_id' 
                      AND to_email = '$email' 
                       OR from_email = '$email'";
  </code></pre>
  
  <p>It actually works and displays the message. It's weird.</p>
  
  <p>Can anyone explain this error message?</p>