Subject | Re: [firebird-php] Using stored procedures in PHP script |
---|---|
Author | Sakhile Njoko |
Post date | 2012-04-09T21:55:12Z |
Thanx Milan
________________________________
From: Milan Babuskov <milanb@...>
To: firebird-php@yahoogroups.com
Sent: Thursday, 5 April 2012, 15:27
Subject: Re: [firebird-php] Using stored procedures in PHP script
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
==================================
[Non-text portions of this message have been removed]
________________________________
From: Milan Babuskov <milanb@...>
To: firebird-php@yahoogroups.com
Sent: Thursday, 5 April 2012, 15:27
Subject: Re: [firebird-php] Using stored procedures in PHP script
Sakhile Njoko wrote:
> 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
==================================
[Non-text portions of this message have been removed]