Subject | Re: [firebird-php] Current firebird_pdo status? |
---|---|
Author | Matthias Hanft |
Post date | 2010-03-09T16:15:02Z |
Lester Caine wrote:
any PDO efforts immediately :-)
(This morning, after the first start of the browser, I actually
got some data rows out of the Firebird database by using my PDO
code from yesterday, but on the second try: segmentation fault
again...)
I have now installed ADOdb (there even was a Gentoo installation
package), and it runs without problems (at least with Firebird -
not tried with mySQL yet). Thank you very much for your hint
about ADOdb - I wouldn't have found it myself apparently (it's
not mentioned on the www.php.net website at all, is it?).
So I just have to struggle with the details (the documentation
is a bit... ehm... messy?!) -
- there is very few information about closing/freeing things
(database connections, SQL statements - is there an "unprepare"?,
result sets and so on). I guess PHP does all this "automagically",
but from other programming languages I'm used to write "close" in
my code when I wrote "open" somewhere before...
- error/exception handling is still a mystery to me. For example,
when the database cannot be opened, the following code
try {
$this->Database=ADONewConnection($dsn);
} catch (Exception $e) {
echo "Open error! Reason: ".$e->getMessage();
}
returns this output:
Warning: ibase_connect() [function.ibase-connect]: Access to database "..." is denied by server
administrator in /usr/share/php5/adodb/drivers/adodb-ibase.inc.php on line 74
Open error! Reason: firebird error: [0: Access to database "..." is denied by server administrator ]
in CONNECT(...)
So I get _two_ error messages. If I use "error_reporting(0);" before,
the error message does get suppressed, but the exception seems to be
gone away as well. For now, I'm just using
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
which suppresses the ibase_connect warning but leaves the exception
intact - but I'm not quite sure if that's good programming practice...
Anyway, ADOdb seems to be the database interface I was looking for -
thanks again for your help!
-Matt
[Non-text portions of this message have been removed]
>Ok, that's a clear and definite answer. Thank you! I'll stop
> Ive been using ADOdb as a proper database abstraction layer, and there
> is a lite
> version of that, as well as a couple of alternatives. But PDO is
> probably a dead
> end as far as database abstraction. It can't even do just the data bit
> as you
> have found ;)
any PDO efforts immediately :-)
(This morning, after the first start of the browser, I actually
got some data rows out of the Firebird database by using my PDO
code from yesterday, but on the second try: segmentation fault
again...)
I have now installed ADOdb (there even was a Gentoo installation
package), and it runs without problems (at least with Firebird -
not tried with mySQL yet). Thank you very much for your hint
about ADOdb - I wouldn't have found it myself apparently (it's
not mentioned on the www.php.net website at all, is it?).
So I just have to struggle with the details (the documentation
is a bit... ehm... messy?!) -
- there is very few information about closing/freeing things
(database connections, SQL statements - is there an "unprepare"?,
result sets and so on). I guess PHP does all this "automagically",
but from other programming languages I'm used to write "close" in
my code when I wrote "open" somewhere before...
- error/exception handling is still a mystery to me. For example,
when the database cannot be opened, the following code
try {
$this->Database=ADONewConnection($dsn);
} catch (Exception $e) {
echo "Open error! Reason: ".$e->getMessage();
}
returns this output:
Warning: ibase_connect() [function.ibase-connect]: Access to database "..." is denied by server
administrator in /usr/share/php5/adodb/drivers/adodb-ibase.inc.php on line 74
Open error! Reason: firebird error: [0: Access to database "..." is denied by server administrator ]
in CONNECT(...)
So I get _two_ error messages. If I use "error_reporting(0);" before,
the error message does get suppressed, but the exception seems to be
gone away as well. For now, I'm just using
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
which suppresses the ibase_connect warning but leaves the exception
intact - but I'm not quite sure if that's good programming practice...
Anyway, ADOdb seems to be the database interface I was looking for -
thanks again for your help!
-Matt
[Non-text portions of this message have been removed]