title: Stored Procedure returns null or empty value in php
body: <p>I am using sql server 2012 and connected to php. when I executing the stored procedure in sql management studio it works fine. but when i calling stored procedure in php it returns empty or null value</p>
  
  <p> I found the root cause. I use PRINT in that stored procedure. if i remove that print in Stored procedure it works fine in php. if i use means it getting empty value</p>
  
  <p>Why? and how to get result from stored procedure in PHP in this scenario ?(sp have print statement)</p>
  
  <p>Stored Procedure:</p>
  
  <pre><code>CREATE PROCEDURE spname 
         @Id INT
  AS
  Begin
      PRINT "some notes"
      SELECT * FROM TABLE_NAME
  end
  </code></pre>
  
  <p><P>Php code</p></p>
  
  <pre><code>$sp="EXEC spname @Id=20";
  $query=$con-&gt;prepare($sp);
  $query-&gt;execute();
  $result = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
  print '&lt;PRE&gt;';
  print_r($result);
  </code></pre>