title: PHP Fatal error: Uncaught PDOException: SQLSTATE[IMSSP]: The active result for the query contains no fields
body: <p>I want to update name and image using PHP Script with Stored Procedure in SQL Server. but the result showing like this</p>
  <blockquote>
  <p>PHP Fatal error:  Uncaught PDOException: SQLSTATE[IMSSP]: The active result for the query contains no fields. in C:\xampp\htdocs\library-api\master.php:943</p>
  </blockquote>
  <p>Here is my profile function on <code>master.php</code></p>
  <pre><code>public function UpdateProfile($name, $image)
  {
      // Statement
      $sqlsrvquery = &quot;
      EXEC [dbo].[UpdateProfile]
      @name = ?,
      @image = ?&quot;;
      $stmt = $this-&gt;conn-&gt;prepare($sqlsrvquery);
      $stmt-&gt;bindParam(1, $name, PDO::PARAM_STR);
      $stmt-&gt;bindParam(2, $image, PDO::PARAM_STR);
      $stmt-&gt;execute();
      if ($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) { //the result error showing here
          $profile_arr[] = array(
              &quot;status&quot; =&gt; true,
              &quot;message&quot; =&gt; &quot;Successfully Update Profile !&quot;
  
  
          );
      } else {
          $profile_arr = array(
              &quot;status&quot; =&gt; false,
              &quot;message&quot; =&gt; &quot;Failed to Update Profile&quot;,
          );
      }
      print_r(json_encode($profile_arr));
  }
  </code></pre>
  <p>And here is my SP</p>
  <pre><code>ALTER Procedure [dbo].[UpdateProfile]
  (
      @name varchar(50),
      @image varchar(MAX)
  )
  as
  begin
      SET NOCOUNT ON
      UPDATE profile set name = @name, image = @image
  END
  </code></pre>
  <p>I am already using <code>SET NOCOUNT ON</code> but its not working properly. Any suggestion of this code? Thanks.</p>