Subject Re: [firebird-php] SPs Docs
Author Milan Babuskov
Nigel Weeks wrote:
> You've actually tried that?

I actually have applications that work like that for two years. You just
made ne re-check, and yes everything is as I wrote. Mine setup:

Linux Mandrake
Firebird 1.0.3 SuperServer
PHP 4.3.7, interbase compiled as module

> I just get:
>
> Warning: ibase_query(): message length error (encountered 0, expected 16) in
> /usr/local/www/data/test.php on line 4
>
> Warning: ibase_fetch_object(): supplied argument is not a valid InterBase
> result resource in /usr/local/www/data/test.php on line 5
>
> My PHP looks like:
>
> <?php
> $conn = ibase_connect("localhost:/u1/db/test.fdb","nigel","nigel");
> $sql = "EXECUTE PROCEDURE SP_INS_TEST('hi')";
> $rec = ibase_query($sql);
> if($obj = ibase_fetch_object($rec)){
> echo "1 ".$obj->RHUBARB."<br>";
> echo "2 ".$obj[0]."<br>";
> }
> ?>
>
> Which PHP version did you use that this worked on?

Various versions from 4.2.3 through 4.3.7.

What does your SP_INS_TEST look like? Is it selectable or not? Judging
from the name, it looks like it is *not*, so why do you try to fetch?

It is *is* selectable, use SELECT and not EXECUTE. Does this work:

$sql = "SELECT * FROM SP_INS_TEST('hi')";

?

--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org