|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Firebird and PHP PDO functions
HI,
I'm trying to connect to a Firebird database using the PHP-PDO functions but I'cant. The problem is the dns that is used to connecto to. At PHP.NET there is an example of how to use the firebird driver with PDO: firebird:User=john;Password=mypass;Database=DATABASE.GDE;DataSource=localhost;Port=3050 If my database is in c:\databases\test.gdb, what should I write to connect to the database? I've tried : 'firebird:User=SYSDBA;Password=masterkey;Database=c:\databases\test.gdb;DataSource=localhost;Port=30 50'; and other connections string and It does not work. Thanks in advance. |
|
#2
|
||||
|
||||
|
This works for me:
Works also with c:\programmi ...
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
__________________
The firebird database CREATE TABLE "T_TEST" ( "INDEX" INTEGER NOT NULL, "DATE" DATE Default 'NOW' NOT NULL, "TEXTE" VARCHAR(30) NOT NULL, PRIMARY KEY ("INDEX") ); _____________ The index.php PHP Code:
__________ The result Array ( [INDEX] => [DATE] => [TEXTE] => ) Array ( [INDEX] => 2 [DATE] => [TEXTE] => Thibault ) ![]() |
|
#4
|
|||
|
|||
|
No data for first row
There is a bug i PDO for Firebird.
see: http://bugs.php.net/bug.php?id=35386 |
|
#5
|
|||
|
|||
|
Quote:
you should try with PHP Code:
(notice the "localhost:" part) Anyway, the PDO_Firebird driver is severely lacking a lot of features. I've posted a test report here: http://www.alberton.info/php_pdo_firebird_status.html I'd recommend using the php_interbase extension until the PDO driver is actively maintained again. |
|
#6
|
|||
|
|||
|
Quote:
So, how did you do to skip the first array, because i have the same problem here, and i dunno how to do it. Thanks ![]() |
|
#7
|
|||
|
|||
|
Quote:
as you could see here [1], it's a bug. While you could retrieve the record (IF the resultset contains more than one record) by reversing the order by clause and fetching the last record returned, it's so hackish that I would NOT consider this option in any case. Again, I'd recommend using the php_interbase extension until the PDO driver is actively maintained again. [1] http://bugs.php.net/bug.php?id=35386 |
|
#8
|
|||
|
|||
|
And if you have only one record, how did you do to get the result ?
Thanx ! Quote:
|
|
#9
|
|||
|
|||
|
Quote:
again, don't use the PDO_Firebird extension, it's NOT usable at the current state: http://www.alberton.info/php_pdo_firebird_status.html Use the php_interbase extension instead. |
|
#10
|
||||
|
||||
|
Quote:
|
|
#11
|
|||
|
|||
|
Quote:
Yes, i'm forced to use PDO with firebird, that's the main reason why i'm a little bit lost. Anyway, there is no way to move from firebird to php_interbase ? And if yes, how to do it ? Thanx |
|
#12
|
|||
|
|||
|
Quote:
if you have the php_interbase extension installed, just use the ibase_* functions instead of the PDO ones ... |
|
#13
|
|||
|