473,230 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

Returning values from stored procedure


Hi all,

I am trying to execute a MS-SQL 2000 stored proedure from PHP 4.2.2 and
return the single row of 3 output values. I've whittled down the error
messages so that I'm now mainly getting an error message that the
MS-SQL Query ($sql) failed.
Here's the stored procedure statements that define the input and output
variables:

CREATE PROCEDURE dbo.sl_mostrecent_State
@MIS int,
@Type int,
@misout int OUTPUT,
@mostrecent varchar (40) OUTPUT,
@nextdue varchar (40) OUTPUT

And, here's my PHP (the 2 input variables, $MIS and $type, are passed
from the previous php page):
<?php

include("configure_report.php");

if ($MIS) {
$conn = mssql_connect($SQLServer,$SQLUsername,$SQLPassword ) or
printError("Unable to connect to Database Server.");

mssql_select_db($SQLDB);

$ANW=' SET ANSI_NULLS ON
SET ANSI_WARNINGS ON';

$sql = mssql_init("sl_mostrecent_State");

$temp = mssql_query($ANW);

mssql_bind($sql, '@MIS', $MIS, SQLINT4, FALSE, FALSE);

mssql_bind($sql, '@Type', $type, SQLINT4, FALSE, FALSE);

mssql_bind($sql, '@misout', $SMIS, SQLINT4, TRUE, FALSE);

mssql_bind($sql, '@mostrecent', $fdate, SQLVARCHAR, TRUE, FALSE);

mssql_bind($sql, '@nextdue', $sdate, SQLVARCHAR, TRUE, FALSE);

$trigger = mssql_query($sql);

mssql_close($conn);

}

?>

Any guidance/ideas would be greatly appreciated!
-Sarah Best

Aug 26 '05 #1
0 1323

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Golawala, Moiz M (GE Infrastructure) | last post by:
Hi All, I am having problem returning values from a Stored Procedure that creates a dynamic table (table variable) inserts values during a procedure and then I select from that dynamic table to...
4
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the...
6
by: Samuel Hon | last post by:
Hi I'm not sure what the best approach for this is: I have a stored procedure which I would like to use to return several output values instead of returning a recordset. CREATE PROCEDURE...
4
by: lekshmi | last post by:
Hi, I have an application written in .Net and my database is SQLserver. In my application i am using SqlAdapters to get the values from the database. But sometimes, values are not returned...
3
by: Mike P | last post by:
Is it possible to return a dataset from a stored procedure, or would you need to write the SQL in your .cs file to return the dataset? Any assistance would be really appreciated. Cheers, ...
2
by: lekshmi | last post by:
Hi, I have an application written in .Net and my database is SQLserver. In my application i am using SqlAdapters to get the values from the database. But sometimes, values are not returned...
1
by: Joe Van Meer | last post by:
Hi all, I have an app that currently runs through 3 seperate stored procedures each returning a count of records. What I would like to do is combine these calls into one call, however I am...
2
by: jzogg7272 | last post by:
In my code I am executing a stored procedure to do a single row insert. I check the return value of the execution and I am getting -1, whereas a few weeks ago it was returning 0. Actually, I found...
4
by: scparker | last post by:
Hello, We have a stored procedure that does a basic insert of values. I am then able to retrieve the ID number created for this new record. We are currently using ASP.NET 2.0 and use N-Tier...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.