Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8610255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:05:14+00:00 2026-06-12T04:05:14+00:00

I am using php to consume a mssql stored procedure, my code works with

  • 0

I am using php to consume a mssql stored procedure, my code works with other stored procs but when I try returning something from this one it just returns bool(false) and not the selected value.

    $para = array(array($this->Forename), array($this->Surname), );  
    $result = mssqldb::query("{call usp_NewCustToOrderRemote(?,?)}", $para);  
    $userid = sqlsrv_fetch_array($result);  var_dump($userid);

The stored proc basically just inserts the parameters and then selects the new row id

    set     @newID = @@IDENTITY
    select @newID

I have no control over the stored procedures so I can’t add a return value.
When I run the stored proc in management tools it runs fine, when I run in php the row is created.
Oh my db connector class is not using mssql but sqlsrv it’s just named incorrectly.
I am I missing something really obvious?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:05:16+00:00Added an answer on June 12, 2026 at 4:05 am

    As my stored procedure updated a row and then returned the ‘select’ I had to use go to the next result as the first result was the row updated.

        sqlsrv_next_result($result);
        $id = sqlsrv_fetch_array($result)[0];
    

    I did add validation as well 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to consume a simple webservice using PHP unfortunately I get the following
I'm attempting to consume a HTTP Basic Auth Secured PHP WebService using VB.NET. I've
Using php I am trying to get some data from a .csv file which
Using PHP, I am trying to delete a record, but I want to check
I'm using RabbitMQ with PHP (via php-amqplib). But server, where my consumer is running,
Hey everyone, I am trying to consume a WebService using PHP SoapClient . Now,
I've made an OAuth Provider using the PHP Extension . This works fine in
I have a PHP SOAP server (using nuSOAP) that I consume with a C#-based
I'm trying to consume a hello world AXIS2 SOAP web service using a PHP
I am using NuSOAP to try to consume a Web Service built in Java.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.