本文整理汇总了PHP中ibase_errmsg函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_errmsg函数的具体用法?PHP ibase_errmsg怎么用?PHP ibase_errmsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_errmsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateError
function updateError($location)
{
//$this->errorNumber = mysql_errno();
$this->errorMessage = ibase_errmsg();
$this->errorLocation = $location;
if ($this->errorNumber && $this->show_error_messages) {
echo '<br /><b>' . $this->errorLocation . '</b><br />' . $this->errorMessage;
flush();
}
}
示例2: 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);
}
示例3: __construct
/**
* This function initializes the class.
*
* @access public
* @override
* @param DB_Connection_Driver $connection the connection to be used
* @param string $sql the SQL statement to be queried
* @param integer $mode the execution mode to be used
* @throws Throwable_SQL_Exception indicates that the query failed
*/
public function __construct(DB_Connection_Driver $connection, $sql, $mode = NULL)
{
$this->resource = $connection->get_resource();
$command = @ibase_query($this->resource, $sql);
if ($command === FALSE) {
throw new Throwable_SQL_Exception('Message: Failed to query SQL statement. Reason: :reason', array(':reason' => @ibase_errmsg()));
}
$this->command = $command;
$this->record = FALSE;
$this->blobs = array();
$count = (int) @ibase_num_fields($command);
for ($i = 0; $i < $count; $i++) {
$field = ibase_field_info($command, $i);
if ($field['type'] == 'BLOB') {
$this->blobs[] = $field['name'];
}
}
}
示例4: dbQuery
function dbQuery($query, $show_errors = true, $all_results = true, $show_output = true)
{
if ($show_errors) {
error_reporting(E_ALL);
} else {
error_reporting(E_PARSE);
}
// Connect to the Firebird/Interbase Sybase database management system
$link = ibase_pconnect("/var/www/sqlmap/dbs/firebird/testdb.fdb", "SYSDBA", "testpass");
if (!$link) {
die(ibase_errmsg());
}
// Print results in HTML
print "<html><body>\n";
// Print SQL query to test sqlmap '--string' command line option
//print "<b>SQL query:</b> " . $query . "<br>\n";
// Perform SQL injection affected query
$result = ibase_query($link, $query);
if (!$result) {
if ($show_errors) {
print "<b>SQL error:</b> " . ibase_errmsg() . "<br>\n";
}
exit(1);
}
print "<b>SQL results:</b>\n";
print "<table border=\"1\">\n";
while ($line = ibase_fetch_assoc($result)) {
// This must stay here for Firebird
if (!$show_output) {
exit(1);
}
print "<tr>";
foreach ($line as $col_value) {
print "<td>" . $col_value . "</td>";
}
print "</tr>\n";
if (!$all_results) {
break;
}
}
print "</table>\n";
print "</body></html>";
}
示例5: execute
public function execute($sql, array $data = null)
{
$this->connect();
if (!is_array($data)) {
$data = array();
}
$data = array_values($data);
foreach ($data as $i => $v) {
switch (gettype($v)) {
case 'boolean':
case 'integer':
$data[$i] = (int) $v;
break;
case 'array':
$data[$i] = implode(',', $v);
break;
case 'object':
$data[$i] = serialize($data[$i]);
break;
case 'resource':
if (is_resource($v) && get_resource_type($v) === 'stream') {
$data[$i] = stream_get_contents($data[$i]);
} else {
$data[$i] = serialize($data[$i]);
}
break;
}
}
array_unshift($data, $sql);
$temp = call_user_func_array("\\ibase_execute", $data);
if (!$temp) {
throw new DatabaseException('Could not execute query : ' . \ibase_errmsg() . ' <' . $sql . '>');
}
$this->aff = \ibase_affected_rows($this->lnk);
return $temp;
}
示例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: error
/**
+----------------------------------------------------------
* 数据库错误信息
* 并显示当前的SQL语句
+----------------------------------------------------------
* @access public
+----------------------------------------------------------
* @return string
+----------------------------------------------------------
* @throws ThinkExecption
+----------------------------------------------------------
*/
public function error()
{
$this->error = ibase_errmsg();
if ($this->debug && '' != $this->queryStr) {
$this->error .= "\n [ SQL语句 ] : " . $this->queryStr;
}
return $this->error;
}
示例9: _execute
/**
* Executes a prepared statement.
*
* @param array $params OPTIONAL Values to bind to parameter placeholders.
* @return bool
* @throws ZendX_Db_Statement_Firebird_Exception
*/
public function _execute(array $params = null)
{
if (!$this->_stmtPrepared) {
return false;
}
// if no params were given as an argument to execute(),
// then default to the _bindParam array
if ($params === null) {
$params = $this->_bindParam;
}
// send $params as input parameters to the statement
if ($params) {
array_unshift($params, $this->_stmtPrepared);
$retval = @call_user_func_array('ibase_execute', $params);
} else {
// execute the statement
$retval = @ibase_execute($this->_stmtPrepared);
}
$this->_stmtResult = $retval;
if ($retval === false) {
$last_error = ibase_errmsg();
$this->_stmtRowCount = 0;
}
//Firebird php ibase extension, auto-commit is not after each call, but at
//end of script. Disabled when transaction is active
if (!$this->_adapter->getTransaction()) {
ibase_commit_ret();
}
if ($retval === false) {
/**
* @see ZendX_Db_Statement_Firebird_Exception
*/
require_once 'ZendX/Db/Statement/Firebird/Exception.php';
throw new ZendX_Db_Statement_Firebird_Exception("Firebird statement execute error : " . $last_error);
}
// statements that have no result set do not return metadata
if (is_resource($this->_stmtResult)) {
// get the column names that will result
$this->_keys = array();
$coln = ibase_num_fields($this->_stmtResult);
$this->_stmtColumnCount = $coln;
for ($i = 0; $i < $coln; $i++) {
$col_info = ibase_field_info($this->_stmtResult, $i);
$this->_keys[] = $this->_adapter->foldCase($col_info['name']);
}
// set up a binding space for result variables
$this->_values = array_fill(0, count($this->_keys), null);
// set up references to the result binding space.
// just passing $this->_values in the call_user_func_array()
// below won't work, you need references.
$refs = array();
foreach ($this->_values as $i => &$f) {
$refs[$i] =& $f;
}
}
if ($trans = $this->_adapter->getTransaction()) {
$this->_stmtRowCount = ibase_affected_rows($trans);
} else {
$this->_stmtRowCount = ibase_affected_rows($this->_adapter->getConnection());
}
return true;
}
示例10: _handleerror
function _handleerror()
{
$this->_errorMsg = ibase_errmsg();
}
示例11: 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
}
示例12: 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());
}
示例13: RollbackTransaction
function RollbackTransaction()
{
$this->Debug("Rollback Transaction");
if ($this->auto_commit) {
return $this->SetError("Rollback transaction", "transactions can not be rolled back when changes are auto commited");
}
if ($this->transaction_id && !ibase_rollback($this->transaction_id)) {
return $this->SetError("Rollback transaction", "Could not rollback a pending transaction: " . ibase_errmsg());
}
if (!($this->transaction_id = ibase_trans(IBASE_COMMITTED, $this->connection))) {
return $this->SetError("Rollback transaction", "Could start a new transaction: " . ibase_errmsg());
}
return 1;
}
示例14: error
/**
* Devuelve el error de Firebird
*
* @return string
*/
public function error($err = '')
{
if (!$this->id_connection) {
$this->last_error = ibase_errmsg() ? ibase_errmsg() : "[Error Desconocido en Firebird: {$err}]";
if ($this->logger) {
Logger::error($this->last_error);
}
return $this->last_error;
}
$this->last_error = ibase_errmsg() ? ibase_errmsg() : "[Error Desconocido en Firebird: {$err}]";
$this->last_error .= $err;
if ($this->logger) {
Logger::error($this->last_error);
}
return $this->last_error;
}
示例15: _sql_error
/**
* return sql error array
* @access private
*/
function _sql_error()
{
return array('message' => @ibase_errmsg(), 'code' => @function_exists('ibase_errcode') ? @ibase_errcode() : '');
}