473,804 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_mostrece nt_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("config ure_report.php" );

if ($MIS) {
$conn = mssql_connect($ SQLServer,$SQLU sername,$SQLPas sword) or
printError("Una ble to connect to Database Server.");

mssql_select_db ($SQLDB);

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

$sql = mssql_init("sl_ mostrecent_Stat e");

$temp = mssql_query($AN W);

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($sq l);

mssql_close($co nn);

}

?>

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

Aug 26 '05 #1
0 1352

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

Similar topics

0
1996
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 furnish values to python. This does not work MY PYTHON CODE IS: import adodbapi connStrSQLServer = r"Provider=SQLOLEDB.1; User ID=sa; Password=tester; Initial Catalog=someDB;Data Source=someSource" db = adodbapi.connect(connStrSQLServer)
4
10907
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 cursor is defined as: SQL_CURSOR delpt_cursor
6
42197
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 Test (@param1 int, @param2 int OUTPUT, @param3 int OUTPUT) AS SELECT field2, field3 FROM Table WHERE field1 = @param1
4
1379
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 properly to these adapters and there are no exceptions also. At this time, all database queries will fail and the solution to this is restart the machine (the client, not the sqlserver)
3
51739
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, Mike
2
1584
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 properly to these adapters and there are no exceptions also. At this time, all database queries will fail and the solution to this is restart the machine (the client, not the sqlserver)
1
1812
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 having an issue getting the output parameters' values after execution. Here is a snipit of code that calls one for simplicity's sake: I think I am close, i was under the impression I could use the datareader to get at it, but is is always returning ...
2
3028
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 that all of my insert stored procs are returning -1. The stored proc/insert statement is still executing successfully but the return code is different. If I execute the procedure from SQL Query Analyzer with the same params, it shows a return...
4
4364
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 Architecture. The Stored Procedures are used through TableAdaptors, which in turn are used by Class Files. I wish to be able to return this new ID value using the Stored
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.