Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

php iseries

Posted on 2014-10-31
3
Medium Priority
?
252 Views
Last Modified: 2014-10-31
I have created a php page below:

<?php

$database = 'S102MCBM';                                
$user = 'user';                                    
$password = 'pwd';                                  
               
$conn = db2_connect($database, $user, $password);      
                   
$stmt = db2_prepare($conn, 'CALL CHKAEON(?)');                      
                                                       
db2_bind_param($stmt, 1, 'usrprf', DB2_PARAM_INOUT);
 
db2_execute($stmt);        
                           
d2_close($conn);          

?>

The code works fine when I use a SQL statement and can fill in a table fine - but when I call this stored procedure above, it doesn't seem to work. So I know the connection works. I know that the program is created as a stored procedure because I call it out of an ASP.Net page ok. I am new to php and iSeries, so maybe I have set up something wrong or am overlooking something.

Does anyone have any ideas?

Thanks in advance.
0
Comment
Question by:samic400
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 40416606
Most PHP functions return values of some sort.  For example, see the online man page here and look for "Return values."
http://php.net/manual/en/function.db2-prepare.php

A good first step in the debugging process is to test these return values to see if they are what you expected, and perhaps visualize them with var_dump().
http://php.net/manual/en/function.var-dump.php
0
 
LVL 13

Author Closing Comment

by:samic400
ID: 40416748
The result came back and checking that at each step threw me an error and told me exactly what was wrong. Thanks for your help!
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 40416785
Bingo!  Thanks for the points and thanks for using E-E. ~Ray
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question