本文介绍了db2 / php随机错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:故意发现两个似乎适用的新闻组,

,阅读了来自各个php群组的数百条消息。


随机我的应用程序获取消息:


警告:odbc_connect():SQL错误:?O * @ |?VA @?§???????,

SQL状态??????????????????????????????????????????????????????????? EW @ ??? a ????在

第15行/var/www/html/GEM/db.php中的SQLConnect

db.php是我的应用程序中使用的常用模块。有时会出现错误

(中间有各种随机垃圾),就像第一次输入

应用程序一样,有时是在很多次之后

分钟/小时的成功运作。对于

安全性略有掩盖的例程如下所示。我在redhat v 8.0的apache 2.0下运行php v 4.3.4(--with-ibm-db2)和

db2 v 8.1.5。


任何帮助(包括参考文献的RTFM,因为我有RTFM

直到我睁眼)将不胜感激。


<?php

// vim:设置ts = 4 sw = 4 ai:

函数showerror($ dbConn){

echo"< br> " ;;

echo" Error.odbc_error($ dbConn)。 " .odbc_errormsg($ dbConn);

echo"< br>" ;;

}

function conn(){

全球$ schema,$ database;

$ schema =" is3" ;;

$ database =" animalst";

$ dbuser =" xxxxxxxx";

$ dbpwd =" xxxxxxxx";

$ dbConn = odbc_connect($ database,$ dbuser,$ dbpwd) ;

if($ dbConn === False){

showerror($ dbConn);

die(无法连接到$数据库);

}

返回$ dbConn;

}

?>

Note: deliberately xposted to the two newsgroups which seem applicable,
after reading several hundred messages from various php groups.

Randomly my application gets the message:

Warning: odbc_connect(): SQL error: O*@|VA@?§??????,
SQL state ????????|????????????\|???????????a??????EW @???a???? in
SQLConnect in /var/www/html/GEM/db.php on line 15
db.php is a common module used throughout my application. The error
(with various random trash in the middle) sometime occurs just as the
application is entered for the first time, sometimes after many
minutes/hours of successful operation. The routine, slightly masked for
security appears below. I am running php v 4.3.4 (--with-ibm-db2) and
db2 v 8.1.5 under apache 2.0 on redhat v 8.0.

Any assistance (including RTFM with references, because I have RTFM
until I am cross-eyed) would be greatly appreciated.

<?php
// vim: set ts=4 sw=4 ai:
function showerror($dbConn) {
echo "<br>";
echo "Error ".odbc_error($dbConn)." ".odbc_errormsg($dbConn);
echo "<br>";
}
function conn() {
global $schema, $database;
$schema = "is3";
$database = "animalst";
$dbuser = "xxxxxxxx";
$dbpwd = "xxxxxxxx";
$dbConn = odbc_connect($database,$dbuser,$dbpwd);
if ( $dbConn===False) {
showerror($dbConn);
die("could not connect to $database");
}
return $dbConn;
}
?>

推荐答案




这篇关于db2 / php随机错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 20:41