Avatar of bromley_college
bromley_college

asked on 

Executing Stored Procedure in MS SQL Server and displaying result in PHP

Hi Experts,

I am trying to execute a stored procedure in SQL SERVER and display the result in PHP.
Here is the Stored Procedure, which does return a value in SQL Server:

CREATE PROCEDURE [dbo].[eAdmissions_Exec_StuSeq]      
AS
BEGIN
      SET NOCOUNT ON;

   DECLARE @i INT;

   EXEC dbo.eAdmissions_GetNextSeq_Stu
   @pSequenceValue = @i OUTPUT;
   SELECT @i as SEQ;
   RETURN @i
END

What do I need to do in PHP to display the result? Is it something like this?

$query = "EXEC eAdmissions_Exec_StuSeq";

$rs = get_recordset ( $conn, $query );

while(odbc_fetch_row($rs)) {
        echo odbc_result($rs, 1);
}


What I am doing wrong?
PHPMicrosoft SQL Server

Avatar of undefined
Last Comment
bromley_college
ASKER CERTIFIED SOLUTION
Avatar of bromley_college
bromley_college

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo