本文整理汇总了PHP中ibase_errcode函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_errcode函数的具体用法?PHP ibase_errcode怎么用?PHP ibase_errcode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_errcode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
function query($query, $unbuffered = false)
{
$result = ibase_query($query, $this->_link);
if (!$result) {
$this->errno = ibase_errcode();
$this->error = ibase_errmsg();
return false;
}
$this->error = "";
if ($result === true) {
$this->affected_rows = ibase_affected_rows($this->_link);
return true;
}
return new Min_Result($result);
}
示例2: error
/**
* 数据库错误信息
* 并显示当前的SQL语句
* @access public
* @return string
*/
public function error()
{
$this->error = ibase_errcode() . ':' . ibase_errmsg();
if ('' != $this->queryStr) {
$this->error .= "\n [ SQL语句 ] : " . $this->queryStr;
}
trace($this->error, '', 'ERR');
return $this->error;
}
示例3: errorCode
public function errorCode()
{
return ibase_errcode($this->handler);
}
示例4: error
/**
* Error
*
* Returns an array containing code and message of the last
* database error that has occured.
*
* @return array
*/
public function error()
{
return array('code' => ibase_errcode(), 'message' => ibase_errmsg());
}
示例5: no_error
/**
* Devuelve el no error de Firebird
*
* @return int
*/
public function no_error()
{
return ibase_errcode();
}
示例6: _setDbError
function _setDbError($query)
{
return $this->_setLastError(ibase_errcode(), ibase_errmsg(), $query);
}
示例7: fetch
/**
* Fetches the row at current position and moves the internal cursor to the next position.
* @param bool TRUE for associative array, FALSE for numeric
* @return array array on success, nonarray if no next record
*/
public function fetch($assoc)
{
DibiDriverException::tryError();
$result = $assoc ? ibase_fetch_assoc($this->resultSet, IBASE_TEXT) : ibase_fetch_row($this->resultSet, IBASE_TEXT);
// intentionally @
if (DibiDriverException::catchError($msg)) {
if (ibase_errcode() == self::ERROR_EXCEPTION_THROWN) {
preg_match('/exception (\\d+) (\\w+) (.*)/is', ibase_errmsg(), $match);
throw new DibiProcedureException($match[3], $match[1], $match[2], dibi::$sql);
} else {
throw new DibiDriverException($msg, ibase_errcode(), dibi::$sql);
}
}
return $result;
}
示例8: date
<?php
include "conexao.php";
$nome = $_POST["nome"];
$email = $_POST["email"];
$assunto = $_POST["assunto"];
$mensagem = $_POST["mensagem"];
$data = date("d.m.Y");
//echo " <br> <br> $nome $email $assunto $mensagem $data ";
$consulta = ibase_query("INSERT INTO TB_MENSAGENS VALUES(1,'{$nome}','{$email}','{$assunto}', '{$mensagem}', '{$data}')");
if (ibase_affected_rows() > 0) {
echo "\n <section id='about'>\n <div class='container'>\n\n <div class='section-header'>\n <h2 class='section-title text-center wow fadeInDown'>Mensagem Recebida</h2>\n <p class='text-center wow fadeInDown'>Responderemos o mais rápido possível</p>\n </div>\n </div>\n </section><!--/#about-->\n\n <div class='container' align='center'>\n <a class='btn btn-primary btn-block' href='index.html'>Voltar</a>\n </div>\n\n <br>\n <br>\n";
} else {
ibase_errcode();
}
?>
<section id="cta2">
<div class="container">
<div class="text-center">
<h2 class="wow fadeInUp" data-wow-duration="300ms" data-wow-delay="0ms"><span>EDUC Aluno</span> o App para consultas acadêmicas</h2>
<p class="wow fadeInUp" data-wow-duration="300ms" data-wow-delay="100ms">Uma ferramenta fácil e prática para consultas academicas.</p>
<p class="wow fadeInUp" data-wow-duration="300ms" data-wow-delay="200ms"><a class="btn btn-primary btn-lg" href="https://play.google.com/store/apps/details?id=br.tecsof.educ">Veja na Google Play</a></p>
<img class="img-responsive wow fadeIn" src="images/cta2/cta2-img.png" alt="" data-wow-duration="300ms" data-wow-delay="300ms">
示例9: fetch
/**
* Fetches a row from the result set.
*
* @param int $style OPTIONAL Fetch mode for this fetch operation.
* @param int $cursor OPTIONAL Absolute, relative, or other.
* @param int $offset OPTIONAL Number for absolute or relative cursors.
* @return mixed Array, object, or scalar depending on fetch mode.
* @throws Zend_Db_Statement_Exception
*/
public function fetch($style = null, $cursor = null, $offset = null)
{
if (!$this->_stmtResult) {
return false;
}
if ($style === null) {
$style = $this->_fetchMode;
}
switch ($style) {
case Zend_Db::FETCH_NUM:
$row = ibase_fetch_row($this->_stmtResult, IBASE_TEXT);
break;
case Zend_Db::FETCH_ASSOC:
$row = ibase_fetch_assoc($this->_stmtResult, IBASE_TEXT);
break;
case Zend_Db::FETCH_BOTH:
$row = ibase_fetch_assoc($this->_stmtResult, IBASE_TEXT);
if ($row !== false) {
$row = array_merge($row, array_values($row));
}
break;
case Zend_Db::FETCH_OBJ:
$row = ibase_fetch_object($this->_stmtResult, IBASE_TEXT);
break;
case Zend_Db::FETCH_BOUND:
$row = ibase_fetch_assoc($this->_stmtResult, IBASE_TEXT);
if ($row !== false) {
$row = array_merge($row, array_values($row));
$row = $this->_fetchBound($row);
}
break;
default:
/**
* @see Zend_Db_Adapter_Firebird_Exception
*/
require_once 'Zend/Db/Statement/Firebird/Exception.php';
throw new Zend_Db_Statement_Firebird_Exception("Invalid fetch mode '{$style}' specified");
break;
}
if (!$row && ($error = ibase_errcode())) {
/**
* @see Zend_Db_Adapter_Firebird_Exception
*/
require_once 'Zend/Db/Statement/Firebird/Exception.php';
throw new Zend_Db_Statement_Firebird_Exception($error);
}
return $row;
}
示例10: query
/**
* Exécute une requète sur la base de données
*
* @param string $query
*
* @access public
* @return mixed
*/
function query($query)
{
if ($this->_matchLimitOffset && preg_match('/\\s+LIMIT\\s+(\\d+)\\s+OFFSET\\s+(\\d+)\\s*$/i', $query, $match)) {
$query = substr($query, 0, -strlen($match[0]));
$query = substr($query, 6);
$query = "SELECT FIRST {$match['1']} SKIP {$match['2']}" . $query;
}
$curtime = array_sum(explode(' ', microtime()));
$result = ibase_query($this->link, $query);
$endtime = array_sum(explode(' ', microtime()));
$this->sqltime += $endtime - $curtime;
$this->lastQuery = $query;
$this->queries++;
if (!$result) {
$this->errno = ibase_errcode();
$this->error = ibase_errmsg();
$this->rollBack();
} else {
$this->errno = 0;
$this->error = '';
if (in_array(strtoupper(substr($query, 0, 6)), array('INSERT', 'UPDATE', 'DELETE')) && $this->autocommit) {
ibase_commit($this->link);
}
if (!is_bool($result)) {
// on a réceptionné une ressource ou un objet
$result = new WadbResult_firebird($this->link, $result);
}
}
return $result;
}
示例11: _sql_error
/**
* return sql error array
* @access private
*/
function _sql_error()
{
// Need special handling here because ibase_errmsg returns
// connection errors, however if the interbase extension
// is not installed then ibase_errmsg does not exist and
// we cannot call it.
if (function_exists('ibase_errmsg')) {
$msg = @ibase_errmsg();
if (!$msg) {
$msg = $this->connect_error;
}
} else {
$msg = $this->connect_error;
}
return array('message' => $msg, 'code' => @function_exists('ibase_errcode') ? @ibase_errcode() : '');
}
示例12: FBUpdate
public function FBUpdate($tableName, $other_request, $exception, $str_where, $intDebug = 0)
{
$nfield = 0;
$nother = 0;
$nexception = count($exception);
if ($this->isTableExist($tableName)) {
$this->erro = 0;
$this->erro_msg = '';
$this->rows = 0;
if ($this->erro == 0) {
$qry_temp = "UPDATE {$tableName} SET ";
$sql = "select FIRST 1 SKIP 1 * from {$tableName} ";
$intQuery = $this->Query($sql, 0, 1);
$coln = $this->GetNumFields($intQuery);
$this->setFieldTable($intQuery);
for ($i = 0; $i < $coln; $i++) {
$col_info = $this->GetFieldInfo($intQuery, $i);
$col_info['name'] = strtolower($col_info['name']);
if (!in_array($col_info['name'], array_change_key_case($exception, CASE_LOWER))) {
if (array_key_exists($col_info['name'], $_REQUEST)) {
$nfield++;
if ($col_info['type'] == 'DATE') {
if ($_REQUEST[$col_info['name']] == '') {
$qry_temp .= $col_info['name'] . '=NULL,';
} else {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart($this->formatDate($_REQUEST[$col_info['name']])) . ',';
}
} elseif (!in_array($col_info['type'], $this->type_string)) {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart(str_replace(',', '', $_REQUEST[$col_info['name']])) . ',';
} else {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart($_REQUEST[$col_info['name']]) . ',';
}
}
if (array_key_exists(strtolower($col_info['name']), array_change_key_case($other_request, CASE_LOWER))) {
$nother++;
if ($col_info['type'] == 'DATE') {
if ($other_request[$col_info['name']] == '') {
$qry_temp .= $col_info['name'] . '=NULL,';
} else {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart($this->formatDate($other_request[$col_info['name']])) . ',';
}
} elseif (!in_array($col_info['type'], $this->type_string)) {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart(str_replace(',', '', $other_request[$col_info['name']])) . ',';
} else {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart($other_request[$col_info['name']]) . ',';
}
}
if ($col_info['type'] == 'TIMESTAMP') {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart('NOW') . ',';
$nfield++;
}
if ($col_info['name'] == 'user_id') {
$qry_temp .= $col_info['name'] . '=' . $this->quote_smart(b_getuserlogin()) . ',';
$nfield++;
}
}
}
$qry_temp .= ')';
$qry_temp = str_replace(',)', ' ', $qry_temp);
$qry_temp .= ' ' . $str_where . ' ';
if ($intDebug) {
echo $qry_temp;
} else {
if ($coln - $nexception != $nfield + $nother) {
echo '$coln: ' . $coln . "\n";
echo '$nexception: ' . $nexception . "\n";
echo '$nfield: ' . $nfield . "\n";
echo '$nother: ' . $nother . "\n";
echo 'Parameter Query Invalid' . "\n";
} else {
//$this->result=@$this->Query($qry_temp,0,1);
$this->result = ibase_query($qry_temp);
if ($this->result) {
$this->erro = 0;
$this->erro_msg = 'Executing Insert Query Success !';
} else {
$this->erro = ibase_errcode();
$this->erro_msg = ibase_errmsg();
}
}
}
}
} else {
$this->erro = 99;
$this->erro_msg = 'Table doesn\'t exist !';
}
return $this->result;
}
示例13: prepare
/**
* Prepare
*
* @param string $sql
* @throws Exception\InvalidQueryException
* @throws Exception\RuntimeException
* @return Statement
*/
public function prepare($sql = null)
{
if ($this->isPrepared) {
throw new Exception\RuntimeException('This statement has already been prepared');
}
$sql = $sql ?: $this->sql;
$this->resource = ibase_prepare($sql);
if ($this->resource === false) {
throw new Exception\RuntimeException(ibase_errmsg(), ibase_errcode());
}
$this->isPrepared = true;
return $this;
}
示例14: error
/**
* Error.
*
* Returns an array containing code and message of the last
* database error that has occured.
*
* @return array
*/
public function error()
{
return ['code' => ibase_errcode(), 'message' => ibase_errmsg()];
}
示例15: query
/**
*@package db_firebird
*@method query()
*@desc Send a Firebird/Interbase query
*@since v0.3.1
*@return bool & Populates $this->resource
* */
public function query($query)
{
$this->sql_query = $query;
if ($this->resource = ibase_query($query)) {
return TRUE;
} else {
// is hanled error
$error_no = ibase_errcode();
$is_handed = false;
if (array_key_exists($error_no, $this->arr_handled_errors)) {
$is_handed = true;
}
if ($is_handed == true) {
$this->error_code = $this->arr_handled_errors[$error_no];
return FALSE;
} else {
// if uknown error
try {
throw new FkException("Firebird/Interbase Error");
} catch (FkException $e) {
$e->description = 'Firebird/Interbase Respondió:' . ibase_errmsg() . '</b>';
$e->solution = 'Verifique la consulta';
$e->solution_code = fk_str_format($query, 'html');
$e->error_code = $error_no;
$e->show('code_help');
}
return FALSE;
}
}
// End else
}