For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > April 2004 > PEAR::DB with sybase strang behaviour









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PEAR::DB with sybase strang behaviour
Konstantin Rekk

2004-04-27, 1:21 am

Hello,

i am using PEAR::DB with sybase,
there is some strange behaviour when using the global Sybase connection
in class function, first the scipt dies when usind dump_var on connection-var,
then result ist not accepted properly by sybase_fetch_row
(using php 4.3.4 with apache):

Init connection in some other class_function:
{
$GLOBALS["dbConnection"] = & DB::connect($dsn ,
array("persistent"=>false,
'debug' => 2,
'portability' =>
DB_PORTABILITY_ALL) );//Datenbankverbindung

....
}


function someFct()
{

// here the server calls the script several time again and again (according
to log-output) to result finally in blank output !!!!!!!!!!????????????????
echo "<br /> "; var_dump($GLOBALS["dbConnection"]);

$result =
$GLOBALS["dbConnection"]->query( $this->page_navigation_query );
//but this works: echo "<br /> "; var_dump($GLOBALS["dbConnection"]);
echo "<br /> last message "; sybase_get_last_message(); // not
output in both cases

//Hier no error is thrown!!!!!!!!! but result set is not valid
//but something similiar works in a function later in the script
//so it seems ok with delay ?!

if ( DB::isError( $result ) ) {
die( $result->getMessage() );
// echo "<br /> died ";var_dump($result);
}
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
echo "<br /> last message "; sybase_get_last_message();
$letters[] = $row["page_letter"];
$page_result_count = (integer)$row["page_result_count"];
//erstes Result
while ( $row = $result->fetchRow(DB_FETCHMODE_ASSOC) ) {

$letters[] = $row["page_letter"];

}
Logging::log( "hier test");
$result->free();

}

Apr 26 14:45:38 [warning] sybase_fetch_assoc(): supplied argument is not a
valid Sybase result resource in /usr/local/php-4.3.4/lib/php/DB/sybase.php a
t line 328
Apr 26 14:45:38 [notice] Undefined property: autofree in /usr/local/php-4.
3.4/lib/php/DB.php at line 895
Apr 26 14:45:38 [warning] sybase_fetch_assoc(): supplied argument is not a
valid Sybase result resource in /usr/local/php-4.3.4/lib/php/DB/sybase.php a
t line 328
Apr 26 14:45:38 [notice] Undefined property: autofree in /usr/local/php-4.
3.4/lib/php/DB.php at line 895
Apr 26 14:45:38 [debug] hier test
Apr 26 14:45:38 [warning] sybase_free_result(): supplied argument is not a
valid Sybase result resource in /usr/local/php-4.3.4/lib/php/DB/sybase.php a
t line 377


I also got log messages like during during in the beginning:

Apr 26 14:33:44 [warning] dl(): Unable to load dynamic library './sybase.so
' - ld.so.1: /usr/local/apache/bin/httpd: fatal: ./sybase.so: open failed: N
o such file or directory in /usr/local/php-4.3.4/lib/php/DB.php at line 710
Apr 26 14:33:44 [warning] dl(): Unable to load dynamic library './sybase.so
' - ld.so.1: /usr/local/apache/bin/httpd: fatal: ./sybase.so: open failed: N
o such file or directory in /usr/local/php-4.3.4/lib/php/DB.php at line 710


Thanks for any ideas!

--
Konstantin Rekk
Berlin
phone: +49 (0) 30 48623452
mobil: 0176 2100 6000
www.rekk.de
www.tanden-aikido.de
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com