Solved

php iseries

Posted on 2014-10-31
3
225 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
  • 2
3 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 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 109

Expert Comment

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

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 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