473,399 Members | 4,254 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,399 software developers and data experts.

How do I retrieve output parameter values by using PHP and ODBC?

1
I'm trying to retrieve values of out parameter by using ODBC and PHP. I've been searching online but to no avail. There are a lot of resolves for PDO and mysqli and I only found this for odbc. I'm kind of lost by the parameter and the operation involve.

Is there any documentation or reference that I can follow? Anyone have any idea on how can I retrieve the data?

This is my code, I'm able to make the connection to the database but the Error in SQL always pops up. I couldn't figure them out.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $conn=odbc_connect("dsn", " ", " ");
  4.  
  5. $result=odbc_exec($conn,"CALL ndTblUser (@varUserId,@varUserPwd)");
  6.  
  7. if (!$conn){
  8.    exit("Connection Failed: " . $conn);
  9. }
  10.  
  11. $sql="CALL ndTblUser (@varUserId,@varUserPwd)";
  12. $stmt=odbc_exec($conn, $sql, "SELECT @varUserId as $UserId, @varUserPwd as $UserPwd)");
  13.  
  14. $rs=odbc_exec($conn,$stmt);
  15.  
  16. if (!$rs) {
  17. exit("Error in SQL");
  18. }
  19.  
  20. echo "<table><tr>";
  21. echo "<th>Id</th>";
  22. echo "<th>Password</th></tr>";
  23.  
  24. while (odbc_fetch_row($rs)) {
  25. $UserId=odbc_result($rs,"UserId");
  26. $UserPwd=odbc_result($rs,"UserPwd");
  27. echo "<tr><td>$UserId</td>";
  28. echo "<td>$UserPwd</td></tr>";
  29. }
  30.  
  31. odbc_close($conn);
  32. ?>
Jan 19 '17 #1
0 1030

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Richard Muller | last post by:
Hi All, I've got the ASP script shown below that complains as follows: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Data source name not found and no default driver specified...
1
by: Eugfene | last post by:
I have the following function in a html file: function selectEdit(fileID, processCode, processID, fileName,fileDesc) { document.forms.recordID.value = fileID; document.forms.processor.value =...
1
by: Abdul Mohsin | last post by:
is it possible to get hidden parameter values using window.opener.document.form.parameter.value. I am getting this error " Object not found" Please help Abdul
3
by: Hewit | last post by:
I have a stored procedure which returns records and output parameters(SQL2K). How to call this stored procedure using ADO.Net so that I can use both results in my application. I have .Net...
8
by: Patreek | last post by:
Hi, On the line where I'm assigning RecordCount to be the value of my output parameter, I'm getting the generic "Object reference not set to an instance of an object" error. I've isolated it...
3
by: juststarter | last post by:
Hello all, I am executing a stored procedure (on an SQL Server) using ODBC but i can't get the output parameter's value on the client. The stored proc has 3 parameters ,2 of them are input and 1...
4
by: Mr Not So Know It All | last post by:
im new to SQL Server and ASP.Net. Here's my problem. I have this SQL Server stored procedure with an input parameter and output parameter CREATE PROCEDURE . @in_rc varchar(8) @out_eList...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
0
by: Sudarsana | last post by:
How to retrieve output parameter value in ASp from Stored Procedure
3
by: bubblediana | last post by:
<?php $county = array (´Kent´,´West Susses´,´East Sussex´,´Sommerset´,´Hampshire´,´London´,´Essex´); $hear = array (´Google´,´Other Search Engine´,´Magazine´,´Recommendation´); function...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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
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.