PHP and returned values from Informix stored procedures
Posted in 2003
Topics: Stored Procedures & SPL
Does anyone know how to retrieve the values returned from an Informix Stored procedure in PHP. I have a procedure that returns 4 values but only 1 row. If I prepare it and then execute it I can not retrieve the results as all of the PHP functions seem to return an array based on the column names, wheras there is no column name associated with the return values. Alternatively is there any way to name the return values from a stored procedure. Thanks to any Informix/PHP gurus Steve Weet XPosted to comp.lang.php
Not particularly pretty, but this function retrieves the values from the spl sp_mailsetup into $result, each elephant of $result is then access via $result['[Expr_1]'] etc $result=ifx_query("execute procedure sp_mailsetup('$ID')",$conn); if($result) { $row=ifx_fetch_row($result,'NEXT'); print $result['[Expr_1]']; print $result['[Expr_2]']; } Steve Weet wrote: > > Does anyone know how to retrieve the values returned from an Informix Stored > procedure in PHP. > > I have a procedure that returns 4 values but only 1 row. If I prepare it and > then execute it I can not retrieve the results as all of the PHP functions seem > to return an array based on the column names, wheras there is no column name > associated with the return values. > > Alternatively is there any way to name the return values from a stored procedure. > > Thanks to any Informix/PHP gurus > > Steve Weet > XPosted to comp.lang.php -- Paul Watson # Oninit Ltd # Growing old is mandatory Tel: +44 1436 672201 # Growing up is optional Fax: +44 1436 678693 # Mob: +44 7818 003457 # www.oninit.com #
You Sir, are a star. Thank you Paul Watson wrote: > Not particularly pretty, but this function retrieves the > values from the spl sp_mailsetup into $result, each elephant > of $result is then access via $result['[Expr_1]'] etc > > $result=ifx_query("execute procedure sp_mailsetup('$ID')",$conn); > if($result) > { > $row=ifx_fetch_row($result,'NEXT'); > print $result['[Expr_1]']; > print $result['[Expr_2]']; > } > >