Jump to content

Chris87

New Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Chris87

  • Rank
    Newbie
  1. Got it! - with the help of this article... https://stackoverflow.com/questions/16735898/the-active-result-contains-no-fields-using-pdo-with-ms-sql In the query - nocount had to be enabled (e.g. $DBH2->query("SET NOCOUNT ON; EXEC pEmplo...............") --- thats a bit of a strange one, because I had already enabled nocount against the database handler like this... $DBH2->query("SET NOCOUNT ON"); - but regardless of that, it had to be in the query statement itself. I now get data! There is still a minor annoyance; If i make the parameters dynamic and un-comment the bindpar
  2. Just tried that - The active result for the query contains no fields. I'm ready to throw my laptop - this is one of those! Not having much luck inserting into another table either..!
  3. Thanks for the reply - I've tried using call from SSMS and it doesnt like that, so I think it needs to remain as 'exec'... i've also tried to capture the result like you have - removing the loop and having a single record..: $STHA->execute(); $result = $STHA->fetch(); var_dump($result); But still no luck - it seems to throw an error at $STHA->fetch(); and again it's reporting no data returned.... but there is most definitely data returned from the query! Since it appears to run the query and just simply doesn't return a result, i'm going to try a
  4. Hi All, I'm hitting brick walls while trying to run a stored procedure query with PDO (linking to MSSQL) If I run the query from SSMS (SQL Server Management Studio) I get a result every time (one single row is returned, as expected) - I'm placing the same query into PHP without any dynamic variables etc - its just a straight query... when it runs the query in PDO it fails every time with this error: PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: The active result for the query contains no fields.' in index.php:195 Stack trace: #0 index.php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.