ID:               35386
 Comment by:       tetikr at spytech dot cz
 Reported By:      slapaf at hotmail dot com
 Status:           Suspended
 Bug Type:         PDO related
 Operating System: winxp sp2
 PHP Version:      5CVS-2006-12-02 (snap)
 Assigned To:      jacques
 New Comment:

This is quite an old bug (2 years!) and yet not fixed in 5.2.4.
Ridiculous! I'm using Doctrine with Firebird and it makes me crazy. Do
something about it, please.


Previous Comments:
------------------------------------------------------------------------

[2007-08-20 15:47:04] dong_peng at 163 dot com

I have met the same problem.

OS : Windows XP SP2
PHP: 5.2.3
Firebird : WI-V6.3.1.12855 Firebird 2.0 

I have a simple table named school in my database, the CREATE TABLE
statement is as below :

CREATE TABLE school
( school_code SMALLINT PRIMARY KEY,
  school_name VARCHAR(40) NOT NULL,
  short_name  VARCHAR(20)
);
And there were total 14 rows in the table, the school_code was from 1
to 14.

When I submitted such a simple query "SELECT * FROM school order by
school_code ASC " to the Firebird Server using PDO, the first row it
returned is NULL,NULL,NULL, while the rest rows can be returned
correctly. In other words only the first row in which the field
'school_code' should be 1 was not right.

Then I tested another query "SELECT * FROM school order by school_code
DESC ", this time the field 'school_code' in the first row should be 14,
however, the result of the first row was still NULL,NULL,NULL, while
other rows was returned correctly, even the row in which the field
'school_code' was 1.

I have tested the following PDO functions :

1.foreach ( $conn->query($query) as $row )
    print_r( $row );

2.$rs=$conn->query($query);
  while( $row=$rs->fetch( ) )
      print_r( $row );

3.$rs=$conn->query($query);
  $data=$rs->fetchall( );
  foreach( $data as $row )
      print_r( $row );

I met the same problem in every test.

So, I tried to access Firebird directly. I used the ibase_* functions
to query the same SQL statement, every row was returned correctly.

And, I have to use PDO to maintain my code in the future, so I tried to
access firebird database via ODBC. This time, I also submitted the same
query using PDO, fortunately, there was no error. Therefore,
I can continue my work with PDO/ODBC/Firebird. I think I can change the
PDO DSN if this bug was corrected in the future.

So, I think there must be something wrong in the Firebird PDO driver.
I hope this problem will be solved as soon as possible.

Brook Dong Peng from China
2007-8-20

------------------------------------------------------------------------

[2007-04-23 08:47:28] no at reply dot cz

Hack didn't work without WHERE at all, with where only first column.
Absolutely useless extension, going to try ibase_*()

------------------------------------------------------------------------

[2007-01-22 20:00:45] tomp at tomaspenc dot com

Crazy solution, but it works:

$stmt = $db->prepare('SELECT * FROM table WHERE 2>?');
$stmt->execute(array(1));
while($radek = $stmt->fetch())
    print_r($radek);

All rows will be printed on the screen including the first.
When you use "prepare statement" with one or more parameters, you get
all rows.

P.S: Srry for my bad english.

------------------------------------------------------------------------

[2006-08-10 08:15:14] [EMAIL PROTECTED]

I'll tinker with this.  No promises though.

------------------------------------------------------------------------

[2006-07-07 10:06:19] mark at verndalesystems dot co dot uk

We have the same problem on Linux running FB 2.0 with PHP 5.1.1

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35386

-- 
Edit this bug report at http://bugs.php.net/?id=35386&edit=1

Reply via email to