db2 + php screwy messages -- HELP, please! I have a persistent but not consistent error occurring in db2 / php
under apache running on two different servers. I rebuilt the database
from the ground up, starting with creates and sequential files on a
second server to no avail. I've tried connecting within sessions to get
the sequentiality thereof. I rebuilt php (4.3.7) to be sure the latest
db2 routines (8.1.5) were included. I modified the apache startup script
to include the db2 environment, as someone recommended. No matter what I
try I continue to receive the following "messages" on a random basis. At
times the application runs for hours without a single message; at other
times I cannot see the first db screen for hours, getting the error
repeatedly, even after restarting my browser, deleting cookies, etc. I
am getting some pressure to switch database systems due to my inability
to resolve this problem. Any (further) help would be GREATLY appreciated.
The screen shot of the message:
-----------------------------------------------------------------
Warning: odbc_connect(): SQL error: ´6ÿ¿|Ú¶ 7ÿ¿Û, SQL state
ýÿÿÿܬ&ýÿÿÿÜ©&Ĭ&ýÿÿÿè:ÿ¿K/·4;ÿ¿ in SQLConnect in
/var/www/html/GEM/db.php on line 32
------------------------------------------------------------------
Added by my application:
The odbc_connect parameters were:[animals] [XXXXXXXX] [XXXXXXXX]
Tried 1 times
[ýÿÿÿܬ][strlen(ýÿÿÿܬ)]
Error number ýÿÿÿܬ=X'fdffffffdcac';
[´6ÿ¿|Ú¶ 7ÿ¿Û][strlen(´6ÿ¿|Ú¶ 7ÿ¿Û)]
Error message ´6ÿ¿|Ú¶ 7ÿ¿Û=X'b436ffbf7cda1cb6a037ffbfdb03';
could not connect to animals
------------------------------------------------------------------
The 'Tried 1 times' is leftover from trying to loop around the
odbc_connect several times to see if that would ameliorate the problem.
Whenever I try this, the app hangs indefinitely for unknown reasons.
While I am new to php / db2, I have had years of experience with
different database systems, including one roll your own. In addition, I
have decades of programming / debugging experience and this problem has
me pulling what little hair I have left out by the roots!
For the curious, here's the failing function:
function conn() {
global $schema, $database;
$schema = "is3";
$database = "animals";
$dbuser = "XXXXXXXX";
// $dsn = "Driver=DB2;Server=localhost;Database=$databas e";
$dsn = $database;
$dbpwd = "XXXXXXXX";
$ct = 0;
// do {
$dbConn = odbc_connect($dsn,$dbuser,$dbpwd);
// $ct += 1;
// if($dbConn==False) { sleep(1); }
// }
// while(($dbConn==False) && ($ct<5)) ;
if ( $dbConn==False) {
printf("<br>The odbc_connect parameters were:[%s] [%s] [%s]<br>\n",
$dsn,$dbuser,$dbpwd);
printf("<br>Tried %d times<br>\n",$ct);
showerror();
odbc_close_all();
die("could not connect to $database");
}
return $dbConn;
} |