Subject | Re: [firebird-php] Using stored procedures in PHP script |
---|---|
Author | Milan Babuskov |
Post date | 2012-04-05T13:27Z |
Sakhile Njoko wrote:
procedures (without SUSPEND) use code like this:
$result = ibase_query("execute procedure proc(param1, param2)");
if (!$result)
echo ibase_errmsg();
For selectable procedures, use something like this:
$result = ibase_query("select * from proc(param1, param2)");
if (!$result)
echo ibase_errmsg();
while ($o = ibase_fetch_object($result))
print_r($o);
If you need insert or update, you should write that on the Firebird side
inside the procedure body. PHP code just calls it.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> Is there a tutorial can help me understand how to call FB stored procedures from a PHP script? If not, an example of insert and select would be greatly appreciated.You execute it just like regular statements. For non-selectable
procedures (without SUSPEND) use code like this:
$result = ibase_query("execute procedure proc(param1, param2)");
if (!$result)
echo ibase_errmsg();
For selectable procedures, use something like this:
$result = ibase_query("select * from proc(param1, param2)");
if (!$result)
echo ibase_errmsg();
while ($o = ibase_fetch_object($result))
print_r($o);
If you need insert or update, you should write that on the Firebird side
inside the procedure body. PHP code just calls it.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================