Solved

php iseries

Posted on 2014-10-31
3
219 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 108

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 108

Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Animated .jpg? 13 63
Use PHPSESSID or create new session when user visits page for the first time 4 40
get domain with php 7 21
is this a cms? 8 36
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now