[PHP-DB] PHP and Firebird

2004-11-30 Thread Anatol Ogórek
Hello.
I noticed, that in the newest PHP release there was added udf file for
interbase/firebird , that allows to execute php functions from sql. I
got interested in it, but after few hours of trying I gave up...
I use Firebidr 1.5 default instalation.
I compile udf file as it is written in c file:
gcc -shared `php-config --includes` `php-config --ldflags`  `php-config
--libs` -o php_ibase_udf.so php_ibase_udf.c
...being in ext/interbase directory.
Everything compiled well. File php_ibase_udf.so was created.
So I copied it to /opt/firebird/UDF
and started isql as SYSDBA with some database file...
And I written:
DECLARE EXTERNAL FUNCTION CALL_PHP1
CSTRING(100),
CSTRING(100) BY DESCRIPTOR,
INTEGER BY DESCRIPTOR
RETURNS PARAMETER 2
ENTRY_POINT 'udf_call_php1' MODULE_NAME 'php_ibase_udf';
and external function was created...
So I try to use this function...
SQL> update FAKTURA set numer =CALL_PHP1('ucwords',numer);
Statement failed, SQLCODE = -902
Access to UDF library "libphp_ibase_udf.so" is denied by server
administrator
So I renamed php_ibase_udf.so to libphp_ibase_udf.so
and tried again...update FAKTURA set numer =CALL_PHP1('ucwords',numer);
Statement failed, SQLCODE = -104
invalid request BLR at offset 16
-function CALL_PHP1 is not defined
-module name or entrypoint could not be found
SQL>
And that's it I do not know what to do next... :(
Can You help me?
Another question is how to open transaction for two different
connections. I saw in changelog that it is possible in newest version
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Re: PHP and Firebird

2004-12-01 Thread Anatol Ogórek
Użytkownik Lester Caine napisał:
Anatol - you seem to be mixing up PHP with Firebird internal UDF, the 
two have nothing in common.

FIRST. Can you actually access Firebird from PHP ( forget UDF totally 
at this stage ).

PHP on Linux needs installing with php_ibase.so in order to access the 
ibase_/fbird_ functions.

Once you have Firebird installed and running then you could look at 
adding UDF's, but they have nothing to do with PHP, and need to be 
compiled on their own.

The firebird-php list will help with getting Firebird running, but you 
need the firebird-support list for UDF's - it's not a PHP problem!

Anatol ogórek wrote:
Hello
I got php+firebird working without any problem.
I am also able to create and compile simple udf for firebird.
I found that one UDF in php source so I thought that maybe someone of 
you managed to use that extension.

Best regards
Anatol
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php