ID: 46848 Comment by: mapopa at gmail dot com Reported By: lestilucio at gmail dot com Status: Open Bug Type: InterBase related Operating System: windows xp professional PHP Version: 5.2.8 New Comment:
I have tested on my ubuntu box (jaunty) with firebird2.1 and php 5.2.6 and the rows are returned correctly $query='SELECT * FROM employee ORDER BY LAST_NAME ASC'; $username = "SYSDBA"; $password = "masterkey"; $host = '/var/lib/firebird/2.1/data/employee.fdb'; $conn = ibase_connect($host, $username, $password,'ISO8859_1',0,2) or die("<br>Connection failed:"); $dati = ibase_query($conn, $query) or die("<br>invalid query"); $i=0; while ($row = ibase_fetch_object ($dati)) { echo ++$i; echo $row->LAST_NAME; Here is the result 1Baldwin2Bender3Bennet4Bishop5Brown6Burbank7Cook8De Souza9Ferrari10Fisher11Forest12Glon13Green14Guckenheimer15Hall16Ichida17Johnson18Johnson19Lambert20Lee21Leung22MacDonald23Montgomery24Nelson25Nordstrom26O'Brien27Osborne28Page29Papadopoulos30Parker31Phong32Ramanathan33Reeves34Stansbury35Steadman36Sutherland37Weston38Williams39Yamamoto40Yanowski41Young42Young Previous Comments: ------------------------------------------------------------------------ [2008-12-12 12:50:45] lestilucio at gmail dot com Description: ------------ Hello, I'm having a problem with an application developed in PHP, with an interbase/firebird database. I have Firebird 2.0.0 installed. I use the following code to display the whole records of a table with a query: Reproduce code: --------------- $query='SELECT * FROM ARTICLES ORDER BY DESCRIPTION ASC'; $username = "SYSDBA"; $password = "masterkey"; $host = 'C:\myposCE\EMPORIUMDB.GDB'; $conn = ibase_connect($host, $username, $password,'ISO8859_1',0,2) or die("<br>Connection failed:"); $dati = ibase_query($conn, $query) or die("<br>invalid query"); while ($row = ibase_fetch_object ($dati)) { echo $row->DESCRIPTION; echo "<BR>"; } Expected result: ---------------- I'm expected to see: 1 - GLASS 2 - TABLE 3 - CHAIR Actual result: -------------- Actual output: 1- TABLE 2- CHAIR The problem is that the query miss the first record of the table. Trying to change the ASC clause in DESC will only miss the last record instead of the first. If my table contains only a record, the query will display nothing at all! How can I solve this problem? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46848&edit=1