PEAR ::DB Interbase/Firebird Query problem freezes the apache o mozilla client
| From: | Francisco Benavides | Date: | Thu, 01 Apr 2004 23:54:41 +0000 |
| Subject: | PEAR ::DB Interbase/Firebird Query problem freezes the apache o mozilla client | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11580@lists.php.net to get a copy of this message | ||
Hi,
I have not been successful into getting any answer from the following
script, I use:
Linux RH 9 2.4.20-8
Apache 2.0.48
PHP 4.3.4
PEAR 1.3b3
Zend Engine 1.3.0
The script connects ok with my running Firebird dB server, but it just
seems to freeze when doing a query (the query works doing it with isql
cmd) and I get nothing (blanck page), how can I debug o what ever to get
to the problem at hand ???
Tips ???
<?php
// Start demo
echo "Pear";
require_once("PEAR.php");
require_once("DB.php");
echo " 1";
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler');
echo " 2";
// Define firebird dB to use
// Set Data Store Name string:
ibase://sysdba:X6vVRe+0@prueba/employee.fdb
$dsn = array(
'phptype' => 'ibase',
'username' => 'sysdba',
'password' => 'X6vVRe+0',
'hostspec' => 'prueba',
'database' => 'employee.fdb',
);
echo " 3";
// Set run time options
$options = array(
'debug' => 2,
'persistent' => true,
);
echo " 4";
// Connect
$db = DB::connect($dsn,$options);
echo " 5";
// SQL Query
$sql = "select * from country";
$result = $db->query($sql);
echo " 6";
// Disconnect
$db->disconnect();
echo " 7";
// End demo
unset( $dsn, $db, $options, $sql, $result );
echo " ok";
function error_handler(&$obj) {
$msg = $obj->getMessage();
$code = $obj->getCode();
$info = $obj->getUserInfo();
printf('<h2 style=color:#cc0000>%s(%d)</h2>',$msg,$code);
if( $info ) {
print Debug info: <pre>;
print htmlspecialchars($info);
print </pre>\n;
}
}
?>