How do I modify this example to contain four input parameters and five output parameters, as well as a results set? To process the results set, it looks like I should use the i5_fetch_array function, is that right?

$sql = "CALL QGPL.TESTPGM(?,?,?,?)";
$stmt= i5_prepare($sql);

$ret = i5_paramdesc($stmt, I5_TYPE_CHAR, 0, 10, 0, I5_INOUT);
$ret = i5_setparam($stmt, 0, $account);

$result = i5_execute($stmt );
if($result === false){
echo "Execute Error:". i5_errno()." Msg:".i5_errormsg()."<br>";

while ($result = i5_fetch_array($stmt)) {
if (!$result =='') {
...
...