|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39494 Cannot fetch any row
Submitted: 2006-11-13 12:24 UTC Modified: 2006-11-15 09:42 UTC
From: taylor dot ren at gmail dot com Assigned:
Status: Not a bug Package: InterBase related
PHP Version: 5.2.0 OS: XP
Private report: No CVE-ID: None
 [2006-11-13 12:24 UTC] taylor dot ren at gmail dot com
I installed PHP with IIS and opened InterBase ext. 

1. IB is OK. I can run separately developed Win32 programs. 
2. PHP is OK. I can load a PHP test file with as simple as phpinfo();
3. ibase_XXXX functions seems OK because there is no error message prompted. 
4. Database/table name OK. 

PHP Interbase script:

Tried in Firefox & IE6. 

Reproduce code:
$connection = ibase_connect('localhost:f:/data/test.ib', 'tr', 'enigma', 'gb_2312');

$sql='select * from t1';
$result=ibase_query($connection, $sql);
	echo (int)$row->id1, "\n";
End of statement. 


Expected result:
I am expecting something like: 

Actual result:
but only the last HTML statement: 

"End of statement" was displayed. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-13 12:28 UTC] taylor dot ren at gmail dot com
BTW, the PHPinfo() prompts the below Interbase related info: 

Firebird/InterBase Support 	dynamic
Compile-time Client Library Version 	Interbase 6
Run-time Client Library Version 	WI-V7.5.1.80

Is it because I am using IB 7.5 but the compile time lib is only IB 6?
 [2006-11-13 12:29 UTC]
What do you get with this script?
$connection = ibase_connect('localhost:f:/data/test.ib', 'tr', 'enigma', 'gb_2312');

$sql='select * from t1';
$result=ibase_query($connection, $sql);
 [2006-11-13 12:48 UTC] taylor dot ren at gmail dot com
Hi Tony, 

Thanks for your quick fdbk. 

The output is like this per your suggest script: 

resource(1) of type (Firebird/InterBase link) bool(false) bool(false)

It seems to me the connection to InterBase is fine but the $result fails after call to ibase_query()... as it returns false...
 [2006-11-13 12:59 UTC]
>resource(1) of type (Firebird/InterBase link) bool(false) bool(false)
Are you sure? There are 4 (four) var_dump() calls, but you showed 3.
What if you put ibase_errmsg() right after the ibase_query() call?
 [2006-11-13 23:38 UTC] taylor dot ren at gmail dot com
Hi Tony, 

Thanks again. 

Code segment now looks like this: 
$connection = ibase_connect('localhost:f:/data/test.ib', 'tr', 'enigma', 'gb_2312');

$sql='select * from t1';
$result=ibase_query($connection, $sql);
End of statement. 

Output now is: 

resource(1) of type (Firebird/InterBase link) NULL bool(false) bool(false) NULL End of statement.

Any further comments? 
 [2006-11-13 23:48 UTC]
Please enable error_reporting(E_ALL) at the top of the script and use _function_ ibase_errmsg(), not variable $ibase_errmsg.
 [2006-11-14 00:10 UTC] taylor dot ren at gmail dot com
Code segment: 

echo "Connection started. \n";
$connection = ibase_connect('localhost:f:/data/test.ib', 'tr', 'enigma', 'gb_2312');
echo "Dumping connection: ", var_dump($connection);
echo "Dumping ibase_errmsg: ",ibase_errmsg();

$sql='select * from t1';
$result=ibase_query($connection, $sql);
echo "Dumping result: ", var_dump($result);
echo "Dumping fetch_row: ", var_dump(ibase_fetch_row($result));
echo "Dumping ibase_errmsg: ", ibase_errmsg();
End of statement. 


Connection started. Dumping connection: resource(1) of type (Firebird/InterBase link) Dumping ibase_errmsg: Dumping result: bool(false) Dumping fetch_row: bool(false) Dumping ibase_errmsg: End of statement.
 [2006-11-15 09:28 UTC] taylor dot ren at gmail dot com
Hi all, 

The problem in this case is identified. In the sample code segment, I found the problem is caused by the fact that "tr" has no "select" right in table "t1". 

It is very strange that ibase_errmsg did not prompt out any errors!

Now I have changed my code to select from another more complex table and got some other error msg. I will try to fix them by myself and then seek help. 

Please close this topic.
 [2006-11-15 09:42 UTC]
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Mar 04 03:01:30 2024 UTC