Solved

php iseries

Posted on 2014-10-31
3
245 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 110

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 110

Expert Comment

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

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

622 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