473,397 Members | 2,028 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,397 software developers and data experts.

Strange values returned from Stored Procedure

Hi
I have been trying to use stored procedures in PHP as shown in the
example below. But all the ones I have tried return strange values.
This simple function simply returns a user id given their logon
details. It should return 89 but returns 24772797. I have tried
different SQL type references shown i.e. SQLINT1 etc. but all do the
same....

I am stuck, HELP PLEASE.... Are there other ways I should be trying. I
am using PHP 5 on IIS6 with SQL SERVER 2000.

-------------------------------------------------------------------------------------------------------------
$link_id = mssql_connect("any","sa","something");
mssql_select_db("dev", $link_id);

$proc = mssql_init("spGetWhoAmILoggedInAs", $link_id);

$login = "LGROUP\J_BLOGGS";

mssql_bind($proc, "@NTAccountLogin", $login, SQLCHAR);
mssql_bind($proc, "@StaffID", &$staffid, SQLINT2, TRUE);

$result = mssql_execute ($proc);

echo "STAFFID - ".$staffid."<br>";
--------------------------------------------------------------------------------------------------------------

Thank you in advance.....

Jun 23 '06 #1
1 1220
Please ignore....... I went through all the SQL types and found my
output value should have been SQLINT4!!!

Sure i'de tried it before..... sorry

Gazchurchend wrote:
Hi
I have been trying to use stored procedures in PHP as shown in the
example below. But all the ones I have tried return strange values.
This simple function simply returns a user id given their logon
details. It should return 89 but returns 24772797. I have tried
different SQL type references shown i.e. SQLINT1 etc. but all do the
same....

I am stuck, HELP PLEASE.... Are there other ways I should be trying. I
am using PHP 5 on IIS6 with SQL SERVER 2000.

-------------------------------------------------------------------------------------------------------------
$link_id = mssql_connect("any","sa","something");
mssql_select_db("dev", $link_id);

$proc = mssql_init("spGetWhoAmILoggedInAs", $link_id);

$login = "LGROUP\J_BLOGGS";

mssql_bind($proc, "@NTAccountLogin", $login, SQLCHAR);
mssql_bind($proc, "@StaffID", &$staffid, SQLINT2, TRUE);

$result = mssql_execute ($proc);

echo "STAFFID - ".$staffid."<br>";
--------------------------------------------------------------------------------------------------------------

Thank you in advance.....


Jun 23 '06 #2

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

Similar topics

0
by: Steve Weet | last post by:
Does anyone know how to retrieve the values returned from an Informix Stored procedure in PHP. I have a procedure that returns 4 values but only 1 row. If I prepare it and then execute it I can...
4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
4
by: shyner | last post by:
Hi Everyone, I've been battling this for two days with no luck. I'm using SQL Server 2000. Here's the mystery: I've got a stored procedure that takes a single varchar parameter to determine...
24
by: LineVoltageHalogen | last post by:
Greetings All, I was hoping that someone out there has run into this issue before and can shed some light on it for me. I have a stored procedure that essentially does a mini ETL from a source...
5
by: Raquel | last post by:
This is a very simple DB2 SQLJ stored procedure. The problem is that it seems to run fine but returns NOTHING. I mean..as if nothing has happened..not resultset is returned. I am passing value...
1
by: Martin Feuersteiner | last post by:
Dear Group I'm having a very weird problem. Any hints are greatly appreciated. I'm returning two values from a MS SQL Server 2000 stored procedure to my Webapplication and store them in...
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...
1
by: satish mullapudi | last post by:
Hi, I am using DB2 v8.2 & jdk 1.4. 1. I have a java program which returns an array which contains 1 to 5 numbers. The code: public class ArrayTest { public static final int ARRAY_SIZE = 5;...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.