本文整理汇总了PHP中odbc_error函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_error函数的具体用法?PHP odbc_error怎么用?PHP odbc_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了odbc_error函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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";
}
开发者ID:nemac,项目名称:flash-fcav,代码行数:31,代码来源:NEMAC_MapViewer_queries.php
示例2: getId
/**
* @see IdGenerator::getId()
*/
public function getId($seqname = null)
{
if ($seqname === null) {
throw new SQLException('You must specify the sequence name when calling getId() method.');
}
$triedcreate = false;
while (1) {
try {
$n = $this->conn->executeUpdate("UPDATE {$seqname} SET id = id + 1", ResultSet::FETCHMODE_NUM);
if ($n == 0) {
throw new SQLException('Failed to update IdGenerator id', $this->conn->nativeError());
}
$rs = $this->conn->executeQuery("SELECT id FROM {$seqname}", ResultSet::FETCHMODE_NUM);
} catch (SQLException $e) {
$odbcerr = odbc_error($this->conn->getResource());
if ($triedcreate || $odbcerr != 'S0000' && $odbcerr != 'S0002') {
throw $e;
}
$this->drop($seqname, true);
$this->create($seqname);
$triedcreate = true;
continue;
}
break;
}
$rs->first();
return $rs->getInt(1);
}
开发者ID:BackupTheBerlios,项目名称:nodin-svn,代码行数:31,代码来源:ODBCIdGenerator.php
示例3: doquery
function doquery($query, $table, $fetch = false)
{
global $link, $debug, $ugamela_root_path;
@(include $ugamela_root_path . 'config.php');
if (!$link) {
$link = odbc_connect($dbsettings["server"], $dbsettings["user"], $dbsettings["pass"]) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
//message(mysql_error()."<br />$query","SQL Error");
odbc_select_db($dbsettings["name"]) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
}
// por el momento $query se mostrara
// pero luego solo se vera en modo debug
$sqlquery = odbc_exec($query, str_replace("{{table}}", $dbsettings["prefix"] . $table)) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
//message(mysql_error()."<br />$query","SQL Error");
unset($dbsettings);
//se borra la array para liberar algo de memoria
global $numqueries, $debug;
//,$depurerwrote003;
$numqueries++;
//$depurerwrote003 .= ;
$debug->add("<tr><th>Query {$numqueries}: </th><th>{$query}</th><th>{$table}</th><th>{$fetch}</th></tr>");
if ($fetch) {
//hace el fetch y regresa $sqlrow
$sqlrow = odbc_fetch_array($sqlquery);
return $sqlrow;
} else {
//devuelve el $sqlquery ("sin fetch")
return $sqlquery;
}
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:29,代码来源:odbc.php
示例4: sql_result
function sql_result($query, $conn = NULL)
{
if (DATABASE == "mysql") {
if (is_null($conn)) {
$qryRslt = @mysql_query($query, $GLOBALS["db_con"]);
} else {
$qryRslt = @mysql_query($query, $conn);
}
if (!$qryRslt) {
echo $query;
error_log(date("F j, Y, g:i a") . "\t{$query}\n" . $_SERVER["PATH_INFO"] . "\n\t" . @mysql_error() . "\n\n", 3, "sql_error.log");
die("<br><font color=\"red\">Due to some technical problem, your Transaction was <b>NOT</b> successful</font>\n");
}
return $qryRslt;
} else {
if (DATABASE == "odbc") {
if (is_null($conn)) {
$qryRslt = @odbc_exec($GLOBALS["db_con"], $query);
} else {
$qryRslt = @odbc_exec($conn, $query);
}
if (!$qryRslt) {
error_log(date("F j, Y, g:i a") . "\t{$query}\n" . $_SERVER["PATH_INFO"] . "\n\t" . @odbc_error() . "\n\n", 3, "sql_error.log");
die("<br><font color=\"red\">Due to some technical problem, your Transaction was <b>NOT</b> successful</font>\n");
}
return $qryRslt;
}
}
}
开发者ID:rugbyprof,项目名称:visitme,代码行数:29,代码来源:sqlfunctions.php
示例5: chkConnect
/**
* check the connection.
*
* @return void
*/
public static function chkConnect($config)
{
$conid = @odbc_connect($config['dsn'], $config['username'], $config['password'], SQL_CUR_USE_ODBC);
if (odbc_error()) {
//return odbc_errormsg(); //SQL Server 2005 不支持 utf-8 编码,其使用 UCS-2 编码架构(所有 unicode 字符都占用 2 个字节)。
return 'connect failed';
}
return true;
}
开发者ID:quan2010,项目名称:DataDictionaryGenerator,代码行数:14,代码来源:Check.php
示例6: 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());
}
}
开发者ID:zendtech,项目名称:ibmitoolkit,代码行数:19,代码来源:Odbcsupp.php
示例7: 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;
}
开发者ID:bubaigcect,项目名称:magictree,代码行数:11,代码来源:class_odbc.php
示例8: 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);
}
}
开发者ID:startsevsa,项目名称:cash,代码行数:12,代码来源:odbc.php
示例9: query
/**
* Send an SQL query
* @param String sql
* @return Mixed
*/
public function query($sql)
{
$this->debugInfo($sql);
$rs = odbc_exec($this->conn, $sql);
if (!$rs) {
trigger_error(odbc_error(), E_USER_ERROR);
return FALSE;
}
odbc_binmode($rs, ODBC_BINMODE_RETURN);
odbc_longreadlen($rs, 1024 * 1024);
return new QueryResult($this, $rs);
}
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:17,代码来源:ODBCConnection.php
示例10: executeQuery
public function executeQuery($sql)
{
//echo $sql;
$res = odbc_exec(self::connection(), $sql);
//execute sql query using db connection
if (!$res) {
throw new Exception(odbc_error());
}
self::closeConnection();
// close db connection
return $res;
//return result resource
}
开发者ID:vallepu,项目名称:my-project-dipak,代码行数:13,代码来源:fromDB.php
示例11: Query
function Query($query)
{
if ($this->conn)
{
$result = odbc_exec($this->conn, $query);
if (odbc_error()) $this->setError(odbc_error());
return $result;
}
else
{
return false;
}
}
开发者ID:rogerwebmaster,项目名称:Philweb,代码行数:13,代码来源:ODBCDatabase.php
示例12: db_query
function db_query($qstring,$conn)
{
global $strLastSQL,$dDebug;
if ($dDebug===true)
echo $qstring."<br>";
$strLastSQL=$qstring;
if(!($rs=odbc_exec($conn,$qstring)))
trigger_error(odbc_error(), E_USER_ERROR);
odbc_binmode($rs,ODBC_BINMODE_RETURN);
odbc_longreadlen($rs,1024*1024);
return $rs;
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:13,代码来源:dbconnection.odbc.php
示例13: ErrorNo
function ErrorNo()
{
if ($this->haserrorfunctions) {
$e = odbc_error($this->_connectionID);
// bug in 4.0.6, error number can be corrupted string (should be 6 digits)
// so we check and patch
if (strlen($e) <= 2) {
return 0;
}
return $e;
} else {
return ADODBConnection::ErrorNo();
}
}
开发者ID:qoire,项目名称:portal,代码行数:14,代码来源:adodb-odbc.inc.php
示例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();
}
}
开发者ID:Tkachov,项目名称:POD,代码行数:15,代码来源:client.php
示例15: open_odbc_connection
function open_odbc_connection()
{
global $debug, $ze_hostname, $ze_login, $ze_pwd, $conn_o;
$cnx_err = false;
// erreur de connexion
if ($debug) {
echo "Ouverture de la connexion ODBC<br />";
}
$conn_o = odbc_connect($ze_hostname, $ze_login, $ze_pwd);
if (!$conn_o) {
$cnx_err = true;
$msg = "Echec de la connexion au serveur : " . odbc_error();
if ($debug) {
echo $msg . "<br>";
}
}
return $cnx_err;
}
开发者ID:onewingedfallen59,项目名称:SmartPlug,代码行数:18,代码来源:connect_db.php
示例16: doquery
function doquery($query, $table, $fetch = false)
{
global $link, $debug, $xnova_root_path;
@(include $xnova_root_path . 'config.php');
if (!$link) {
$link = odbc_connect($dbsettings["server"], $dbsettings["user"], $dbsettings["pass"]) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
odbc_select_db($dbsettings["name"]) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
}
$sqlquery = odbc_exec($query, str_replace("{{table}}", $dbsettings["prefix"] . $table)) or $debug->error(odbc_error() . "<br />{$query}", "SQL Error");
unset($dbsettings);
global $numqueries, $debug;
$numqueries++;
$debug->add("<tr><th>Query {$numqueries}: </th><th>{$query}</th><th>{$table}</th><th>{$fetch}</th></tr>");
if ($fetch) {
$sqlrow = odbc_fetch_array($sqlquery);
return $sqlrow;
} else {
return $sqlquery;
}
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:20,代码来源:odbc.php
示例17: processInterface
public function processInterface()
{
// Make sure there was no conneg error prior to this process call
if ($this->ws->conneg->getStatus() == 200) {
$this->ws->validateQuery();
// If the query is still valid
if ($this->ws->conneg->getStatus() == 200) {
// Create and describe the resource being registered
// Note: we make sure we remove any previously defined triples that we are
// about to re-enter in the graph. All information other than these
// new properties will remain in the graph
$query = "delete from <" . $this->ws->wsf_graph . ">\n { \n <" . $this->ws->registered_uri . "> a <http://purl.org/ontology/wsf#WebService> .\n <" . $this->ws->registered_uri . "> <http://purl.org/dc/terms/title> ?title . \n <" . $this->ws->registered_uri . "> <http://purl.org/ontology/wsf#endpoint> ?endpoint .\n <" . $this->ws->registered_uri . "> <http://purl.org/ontology/wsf#hasCrudUsage> ?crud_usage .\n ?crud_usage ?crud_property ?crud_value .\n }\n where\n {\n graph <" . $this->ws->wsf_graph . ">\n {\n <" . $this->ws->registered_uri . "> a <http://purl.org/ontology/wsf#WebService> .\n <" . $this->ws->registered_uri . "> <http://purl.org/dc/terms/title> ?title . \n <" . $this->ws->registered_uri . "> <http://purl.org/ontology/wsf#endpoint> ?endpoint .\n <" . $this->ws->registered_uri . "> <http://purl.org/ontology/wsf#hasCrudUsage> ?crud_usage .\n ?crud_usage ?crud_property ?crud_value .\n }\n }\n insert into <" . $this->ws->wsf_graph . ">\n {\n <" . $this->ws->registered_uri . "> a <http://purl.org/ontology/wsf#WebService> .\n <" . $this->ws->registered_uri . "> <http://purl.org/dc/terms/title> \"" . $this->ws->registered_title . "\" .\n <" . $this->ws->registered_uri . "> <http://purl.org/ontology/wsf#endpoint> \"" . $this->ws->registered_endpoint . "\" .\n <" . $this->ws->registered_uri . "> <http://purl.org/ontology/wsf#hasCrudUsage> <" . $this->ws->registered_uri . "usage/> .\n \n <" . $this->ws->registered_uri . "usage/> a <http://purl.org/ontology/wsf#CrudUsage> ;\n <http://purl.org/ontology/wsf#create> " . ($this->ws->crud_usage->create ? "\"True\"" : "\"False\"") . " ;\n <http://purl.org/ontology/wsf#read> " . ($this->ws->crud_usage->read ? "\"True\"" : "\"False\"") . " ;\n <http://purl.org/ontology/wsf#update> " . ($this->ws->crud_usage->update ? "\"True\"" : "\"False\"") . " ;\n <http://purl.org/ontology/wsf#delete> " . ($this->ws->crud_usage->delete ? "\"True\"" : "\"False\"") . " .\n \n <" . $this->ws->wsf_graph . "> <http://purl.org/ontology/wsf#hasWebService> <" . $this->ws->registered_uri . ">.\n }";
@$this->ws->db->query($this->ws->db->build_sparql_query(str_replace(array("\n", "\r", "\t"), " ", $query), array(), FALSE));
if (odbc_error()) {
$this->ws->conneg->setStatus(500);
$this->ws->conneg->setStatusMsg("Internal Error");
$this->ws->conneg->setStatusMsgExt($this->ws->errorMessenger->_300->name);
$this->ws->conneg->setError($this->ws->errorMessenger->_300->id, $this->ws->errorMessenger->ws, $this->ws->errorMessenger->_300->name, $this->ws->errorMessenger->_300->description, odbc_errormsg(), $this->ws->errorMessenger->_300->level);
return;
}
}
}
}
开发者ID:neuroidss,项目名称:OSF-Web-Services,代码行数:23,代码来源:DefaultSourceInterface.php
示例18: processInterface
public function processInterface()
{
// Make sure there was no conneg error prior to this process call
if ($this->ws->conneg->getStatus() == 200) {
$this->ws->validateQuery();
// If the query is still valid
if ($this->ws->conneg->getStatus() == 200) {
$dateTime = date("c");
/*
Ordered changes for a record using sparql and this part of the WSF ontology.
sparql select * from <http://.../wsf/track/> where
{
?s <http://purl.org/ontology/wsf#record> <http://.../wsf/datasets/67/resource/Welfare> .
?s <http://purl.org/ontology/wsf#changeTime> ?time.
}
ORDER BY asc(xsd:dateTime(?time));
*/
$trackRecord = "<" . $this->ws->wsf_graph . "track/record/" . md5($dateTime . $this->ws->record . $this->ws->fromDataset) . "> \n a <http://purl.org/ontology/wsf#ChangeState> ;";
$trackRecord .= "<http://purl.org/ontology/wsf#record> <" . $this->ws->record . "> ;";
$trackRecord .= "<http://purl.org/ontology/wsf#fromDataset> <" . $this->ws->fromDataset . "> ;";
$trackRecord .= "<http://purl.org/ontology/wsf#changeTime> \"" . $dateTime . "\"^^xsd:dateTime ;";
$trackRecord .= "<http://purl.org/ontology/wsf#action> \"" . $this->ws->action . "\" ;";
$trackRecord .= "<http://purl.org/ontology/wsf#previousState> \"\"\"" . $this->ws->previousState . "\"\"\" ;";
$trackRecord .= "<http://purl.org/ontology/wsf#previousStateMime> \"" . $this->ws->previousStateMime . "\" ;";
$trackRecord .= "<http://purl.org/ontology/wsf#performer> \"" . $this->ws->performer . "\" .";
$this->ws->db->query("DB.DBA.TTLP_MT('" . addslashes($trackRecord) . "', '" . $this->ws->wsf_graph . "track/" . "', '" . $this->ws->wsf_graph . "track/" . "')");
if (odbc_error()) {
$this->ws->conneg->setStatus(400);
$this->ws->conneg->setStatusMsg("Bad Request");
$this->ws->conneg->setError($this->ws->errorMessenger->_302->id, $this->ws->errorMessenger->ws, $this->ws->errorMessenger->_302->name, $this->ws->errorMessenger->_302->description, odbc_errormsg(), $this->ws->errorMessenger->_302->level);
return;
}
}
}
}
开发者ID:neuroidss,项目名称:OSF-Web-Services,代码行数:37,代码来源:DefaultSourceInterface.php
示例19: _query
function _query($sql, $inputarr = false)
{
global $php_errormsg;
if (isset($php_errormsg)) {
$php_errormsg = '';
}
$this->_error = '';
if ($inputarr) {
if (is_array($sql)) {
$stmtid = $sql[1];
} else {
$stmtid = odbc_prepare($this->_connectionID, $sql);
if ($stmtid == false) {
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
return false;
}
}
if (!odbc_execute($stmtid, $inputarr)) {
//@odbc_free_result($stmtid);
if ($this->_haserrorfunctions) {
$this->_errorMsg = odbc_errormsg();
$this->_errorCode = odbc_error();
}
return false;
}
} else {
if (is_array($sql)) {
$stmtid = $sql[1];
if (!odbc_execute($stmtid)) {
//@odbc_free_result($stmtid);
if ($this->_haserrorfunctions) {
$this->_errorMsg = odbc_errormsg();
$this->_errorCode = odbc_error();
}
return false;
}
} else {
$stmtid = odbc_exec($this->_connectionID, $sql);
}
}
$this->_lastAffectedRows = 0;
if ($stmtid) {
if (@odbc_num_fields($stmtid) == 0) {
$this->_lastAffectedRows = odbc_num_rows($stmtid);
$stmtid = true;
} else {
$this->_lastAffectedRows = 0;
odbc_binmode($stmtid, $this->binmode);
odbc_longreadlen($stmtid, $this->maxblobsize);
}
if ($this->_haserrorfunctions) {
$this->_errorMsg = '';
$this->_errorCode = 0;
} else {
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
}
} else {
if ($this->_haserrorfunctions) {
$this->_errorMsg = odbc_errormsg();
$this->_errorCode = odbc_error();
} else {
$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : '';
}
}
return $stmtid;
}
开发者ID:joeymetal,项目名称:v1,代码行数:66,代码来源:adodb-odbc.inc.php
示例20: getErrno
public function getErrno()
{
return $this->_link ? odbc_errormsg($this->dbConnection()) : odbc_error($this->dbConnection());
}
开发者ID:huangbinzd,项目名称:kppwGit,代码行数:4,代码来源:odbc_driver.php
注:本文中的odbc_error函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论