468,537 Members | 1,844 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,537 developers. It's quick & easy.

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 1196

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Golawala, Moiz M (GE Infrastructure) | last post: by
4 posts views Thread by Michael Trosen | last post: by
4 posts views Thread by lekshmi | last post: by
3 posts views Thread by Mike P | last post: by
2 posts views Thread by lekshmi | last post: by
1 post views Thread by Joe Van Meer | last post: by
4 posts views Thread by scparker | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.