PHP 4.0 Bug #7014: ibase_query (rest of php_interbase.dll?)
| From: | jccann at home dot com | Date: | Wed, 04 Oct 2000 14:29:37 +0000 |
| Subject: | PHP 4.0 Bug #7014: ibase_query (rest of php_interbase.dll?) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34210@lists.php.net to get a copy of this message | ||
From: jccann@home.com
Operating system: NT 4.0 SP5
PHP version: 4.0.2
PHP Bug Type: InterBase related
Bug description: ibase_query (rest of php_interbase.dll?)
Environment:
Binary distro of PHP 4.0.2
NT 4.0 (SP5)
Apache 1.3.2
Interbase ISQL Version: WI-V6.0.0.627
InterBase/x86/Windows NT (access method),
version "WI- V6.0.0.627" on disk structure version 10.0
When I try to fetch a record using ibase_query that is encapsulated into a class, it does not work
and I receive:
"Warning: InterBase: invalid transaction handle (expecting explicit transaction start) in
c:\program files\apache group\apache\htdocs\ibasetest.php on line 30"
Run the following script to duplicate. Note that if you comment lines 2-19 and 38-48, you will run
the fetch without creating the object. In this case (non-object), the fetch works.
BTW - The uncommented (i.e., object version) works great on my Linux box (PHP 4.0.0 + Interbase
6.0).
Thanks.
P.S. If you need interbase testing or test scripts, I would be happy to help. The interbase DLL is
*really* shaky in NT for PHP 4.0.2.
--------- IbaseTest.php -----------
<?php
/* Comment from here */
include_once( 'Audit.php' );
include_once( 'Form.php' );
class IbaseTest {
function insert() {
$sql = "INSERT INTO AUDITS ( AUDIT_ID, INSERT_USER, INSERT_DATE )
VALUES ( GEN_ID( AUDIT_GEN, 1 ), 'IbaseTest', 'NOW' );";
echo "instantiate IbaseTest()<br>";
$form = new Form();
echo "insertRecord()<br>";
$form->insertRecord( $sql );
}
function fetch() {
/* to here to make this work (more comments below) */
$sql = "SELECT MAX(AUDIT_ID) FROM AUDITS;";
$dbServer = "localhost";
$passwd = "x8fg73ca";
$dbName = "C:\Program Files\BORLAND\InterBase\data\mut.gdb";
$user = "mtnunion";
$connect = $dbServer . ":" . $dbName;
echo "connect<br>";
$dbh = ibase_connect( $connect, $user, $passwd );
echo "connection handle: $dbh<br>";
echo "query<br>";
$sth = ibase_query( $sql, $dbh );
echo "fetch_row<br>";
$row = ibase_fetch_row ( $sth );
echo "free_result<br>";
ibase_free_result( $sth );
echo "close<br>";
ibase_close( $dbh );
echo "fetched id: $row[0]<br>";
/* comment to end of script */
}
}
echo "instantiate IbaseTest()<br>";
$test = new IbaseTest();
echo "insert()<br>";
$test->insert();
echo "fetch()<br>";
$test->fetch();
/**/
?>