本文整理汇总了PHP中odbc_errormsg函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_errormsg函数的具体用法?PHP odbc_errormsg怎么用?PHP odbc_errormsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了odbc_errormsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _catch
function _catch($msg = "")
{
if (!($this->error = odbc_errormsg($this->conn))) {
return true;
}
$this->error($msg . "<br>{$this->query} \n {$this->error}");
}
示例2: HandleError
protected function HandleError($conn)
{
if (Config::DAO_DEBUG_MODE == 1) {
odbc_errormsg($conn);
}
return false;
}
示例3: query
/**
* Enter description here...
*
* @param unknown_type $query
*
* @return unknown
*/
public static function query($query)
{
if (!($var = \odbc_exec(self::$conn, $query))) {
throw new DBException('(' . $query . ') had an error: ' . \odbc_errormsg());
}
return $var;
}
示例4: changeUserPassword
public function changeUserPassword($userName, $userOldPassword, $userNewPassword, $portalID)
{
VDSN;
$conn = odbc_connect(VDSN, USER, PW) or die('ODBC Error:: ' . odbc_error() . ' :: ' . odbc_errormsg() . ' :: ' . VDSN);
//test for user name
if ($conn) {
$sql = "SELECT '1' outputFlag FROM Portal_User WHERE User_Name = '" . $userName . "' AND Portal_ID = '" . $portalID . "'";
$rs = odbc_exec($conn, $sql);
$row = odbc_fetch_row($rs);
if ($row == null) {
odbc_close($conn);
return "You have entered an invalid user name; please try again.";
}
}
//test for password
if ($conn) {
$sql = "SELECT '1' FROM Users WHERE User_Name = '" . $userName . "' AND User_Password = '" . $userOldPassword . "'";
$rs = odbc_exec($conn, $sql);
$row = odbc_fetch_row($rs);
if ($row == null) {
odbc_close($conn);
return "You have entered an invalid password for your account; please try again.";
}
}
//save new password
if ($conn) {
$sql = "UPDATE Users SET User_Password = '" . $userNewPassword . "' WHERE User_Name = '" . $userName . "'";
$rs = odbc_exec($conn, $sql);
}
return "OK";
}
示例5: db_erro
function db_erro($db_resource)
{
$erro = odbc_errormsg($db_resource);
if (!empty($erro)) {
echo 'ERRO: ' . $erro;
}
}
示例6: ErrorMsg
function ErrorMsg()
{
if ($this->haserrorfunctions) {
return odbc_errormsg($this->_connectionID);
} else {
return ADODBConnection::ErrorMsg();
}
}
示例7: setError
/**
* set error code and message based on last odbc connection/prepare/execute error.
*
* @todo: consider using GET DIAGNOSTICS for even more message text:
* http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Frzala%2Frzalafinder.htm
*
* @param null $conn
*/
protected function setError($conn = null)
{
// is conn resource provided, or do we get last error?
if ($conn) {
$this->setErrorCode(odbc_error($conn));
$this->setErrorMsg(odbc_errormsg($conn));
} else {
$this->setErrorCode(odbc_error());
$this->setErrorMsg(odbc_errormsg());
}
}
示例8: ErrorMsg
function ErrorMsg()
{
if ($this->_haserrorfunctions) {
if (empty($this->_connectionID)) {
return @odbc_errormsg();
}
return @odbc_errormsg($this->_connectionID);
} else {
return ADOConnection::ErrorMsg();
}
}
示例9: die_sql
private function die_sql($sql, $line, $file, $function, $class)
{
error_log($file . ' : L ' . $line . chr(10) . $sql . chr(10) . odbc_errormsg($this->link));
$err = '<span style="font-size:18px;font-weight:bold;">lisha</span><br /><br />';
$err .= 'Erreur MySQL<br /><br />';
$err .= '<b style="color:#DD2233;">Erreur ' . odbc_error($this->link) . "</b> : <b>" . odbc_errormsg($this->link) . '</b><br /><br />';
$err .= 'Classe : ' . $class . ' - Ligne : ' . $line . ' - ' . $file . ' - ' . $function . '<br /><br /><br />';
$err .= '<textarea style="width:90%;height:200px;;">' . $sql . '</textarea>';
echo $err;
die;
}
示例10: raiseError
public function raiseError($sql = NULL, $prms = array())
{
$error_id = odbc_error($this->_con);
if (strlen($error_id) == 5) {
$error_msg = "[" . $error_id . "] " . odbc_errormsg($this->_con);
//odbc_close($this->_con);
if (!empty($sql)) {
$error_msg = $error_msg . "-------------------------\nSQL trace: " . $sql . ", \n-------------------------\nParams: " . print_r($prms, 1);
}
throw new Error($error_msg);
}
}
示例11: query
function query($sql)
{
$this->conn = $this->db_connect() or die("No fue posible connectar con la base de dados -> " . "{$this->database}");
if ($res = odbc_exec($this->conn, $sql) or die("Inválida: " . odbc_errormsg())) {
return $res;
} else {
echo "No es posible ejecutar esta consulta: <br>";
echo "{$sql}";
$this->db_close($this->conn);
return false;
}
}
示例12: get_results
function get_results($query)
{
global $con;
if ($query == "") {
echo "";
} else {
$res = @odbc_exec($con, $query);
if ($res) {
odbc_result_all($res);
} else {
echo odbc_errormsg($con);
}
}
}
示例13: myOdbcConnect
/**
* Helper function for connecting to a odb database.
* Just does some error checking.
*
* Returns NULL on error.
*
*/
function myOdbcConnect($dataSourceName, $username, $password)
{
if (!function_exists('odbc_connect')) {
//$logger->log(WARN,
Logger::warn("Virtuoso adapter requires PHP ODBC extension to be loaded");
return NULL;
}
$con = @odbc_connect($dataSourceName, $username, $password);
if (null == $con) {
//$logger->log(WARN,
Logger::warn("Unable to connect to Virtuoso Universal Server via ODBC: " . odbc_errormsg());
return NULL;
}
return $con;
}
示例14: login
private function login(client_login_info $login_info)
{
//TODO: odbc connect probably supports these DSNs: http://www.connectionstrings.com/oracle/
//may be something like "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;"
$connect = odbc_connect($login_info->DSN, $login_info->user, $login_info->pass);
if ($connect === false) {
$this->login_error_message = odbc_error() . ": " . odbc_errormsg();
} else {
$this->logged_in = true;
$this->connection = $connect;
}
if ($this->logged_in) {
$login_info->save_in_cookies();
}
}
示例15: OM_InnovExport_Order_Release
function OM_InnovExport_Order_Release($OrderNumber)
{
if ($OrderNumber != '') {
$connect = odbc_connect("qa-om", "sa", "systemop", SQL_CUR_USE_ODBC);
if (!$connect) {
exit("Connection Failed: " . $connect);
}
$sql = "use QAData update Orders set InnovExport = '0' where OrderNumber = '{$OrderNumber}'";
$result = odbc_exec($connect, $sql);
if (!$result) {
odbc_errormsg($connect);
exit("Error in SQL");
}
echo '<table class="table_main">';
echo "<tr><td colspan='6' style='text-align:center;color:green;'>Reset {$OrderNumber}</td></tr>";
echo '</table>';
}
}