Solved

php iseries

Posted on 2014-10-31
3
208 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
Comment Utility
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
Comment Utility
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
Comment Utility
Bingo!  Thanks for the points and thanks for using E-E. ~Ray
0

Featured Post

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 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

10 Experts available now in Live!

Get 1:1 Help Now