Note that there are some explanatory texts on larger screens.

plurals
  1. POI can't get records from a stored procedure
    text
    copied!<p>I can't get records from a stored procedure. If I run from SQL Server, I get records. If I call it from .NET, I get records... but if I call it from PHP, I don't get records.</p> <p>I am using PHP 5.3.3 on CentOS 6. I am using mssql. All others SP are ok.</p> <p>I tried</p> <pre><code>$provider = 1010; $array = array(); $stmt2 = mssql_init("[dbo].[PORA_sp_GET_LetterGenerationRecords]"); mssql_bind($stmt2, "@ProviderID", $provider, SQLINT4); $letters = mssql_execute($stmt2); while($row = mssql_fetch_assoc($letters)){ $array[] = $row; } mssql_free_statement($stmt2); echo '&lt;pre&gt;'; print_r($array); echo '&lt;/pre&gt;'; </code></pre> <p>and I have </p> <pre><code>Array ( ) </code></pre> <p>I tried too</p> <pre><code>$array = array(); $letters = mssql_query('EXEC [dbo].[PORA_sp_GET_LetterGenerationRecords] @ProviderID = 1010'); while($row = mssql_fetch_assoc($letters)){ $array[] = $row; } echo '&lt;pre&gt;'; print_r($array); echo '&lt;/pre&gt;'; </code></pre> <p>and I got </p> <pre><code>Array ( ) </code></pre> <p>I included</p> <pre><code>echo 'MSSQL error: '. mssql_get_last_message(); </code></pre> <p>and the answer:</p> <pre><code>MSSQL error: </code></pre> <p>I am very curious. Right now I am running the SP step by step from PHP. It's a shameful.</p> <p>I tried:</p> <pre><code> $provider = 1010; $array = array(); // $letters = mssql_query('EXEC [dbo].[PORA_sp_GET_LetterGenerationRecords] @ProviderID = 1010'); $stmt2 = mssql_init("[dbo].[PORA_sp_GET_LetterGenerationRecords]"); mssql_bind($stmt2, "@ProviderID", $provider, SQLINT4); $letters = mssql_execute($stmt2); if($letters){ echo mssql_num_rows($letters); while($row = mssql_fetch_assoc($letters)){ $array[] = $row; } mssql_free_statement($stmt2); echo '&lt;pre&gt;'; print_r($array); echo '&lt;/pre&gt;'; } else{ echo 'MSSQL error: '. mssql_get_last_message(); echo error_get_last(); } </code></pre> <p>and same answer.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload