There are good resources at the Zend i5/OS forums.
www.zend.com/forums
This is an example from Jon Paris from a while ago.
<?
// $conn = i5_connect("localhost", "MYUSERID", "MYPASSWORD");
// if (!$conn) {
// throw_error("i5_connect");
// exit(); }
$description = array(
array("Name"=>"PROD_ID", "IO"=>I5_IN,
"Type"=>I5_TYPE_CHAR, "Length"=>"7" ),
array("Name"=>"STORE_LOC", "IO"=>I5_IN,
"Type"=>I5_TYPE_CHAR, "Length"=>"10" ),
array("Name"=>"PRICE", "IO"=>I5_INOUT,
"Type"=>I5_TYPE_PACKED, "Length"=>"5.2" ),
);
$pgm = i5_program_prepare("LIBRARY/PHPTEST", $description);
if (!$pgm) {
throw_error("i5_program_prepare");
exit();
}
$parameter = array("PROD_ID"=>"xyz101","STORE_LOC"=>"a1001",
"PRICE"=>100.00);
$parmOut = array("PROD_ID"=>"PROD_ID", "STORE_LOC"=>"STORE_LOC",
"PRICE"=>"AMOUNT");
$ret = i5_program_call($pgm, $parameter, $parmOut);
if (!$ret) {
throw_error("i5_program_call");
exit();
}
echo "Product Id: ".$PROD_ID."<br>";
echo "Store Location: ".$STORE_LOC."<br>";
echo "Price: ".$AMOUNT."<br>";
i5_program_close($pgm);
i5_close($conn);
function throw_error($func) {
echo "Error in function: ".$func." --- ";
echo "Error Number: ".i5_errno()." --- ";
echo "Error Message: ".i5_errormsg()."<br>";
}
?>
====================================
// Should really use PR/PI but ...
C *ENTRY PLIST
C PARM prod_id 7
C PARM store_loc 10
C PARM price 5 2
/FREE
price = price + 10.99;
*INLR = *ON;
/END-FREe
================================
Bryan Dietz
On Wed, Oct 1, 2008 at 12:36 PM, Gerald <gmagnuson@xxxxxxxxxxxxx> wrote:
I have created a stored procedure (in RPGLE), that accepts an input parm
(customer number), and returns back a number (active orders).
However, I can't explain to our PHP coders how to structure the call?
we connect to the system i with ODBC.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.