本文整理汇总了PHP中ibase_errmsg函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_errmsg函数的具体用法?PHP ibase_errmsg怎么用?PHP ibase_errmsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_errmsg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
}
开发者ID:shoaibali,项目名称:ispconfig3,代码行数:10,代码来源:db_firebird.inc.php
示例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);
}
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:15,代码来源:firebird.inc.php
示例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'];
}
}
}
开发者ID:ruslankus,项目名称:invoice-crm,代码行数:28,代码来源:Standard.php
示例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>";
}
开发者ID:dieface,项目名称:testenv,代码行数:43,代码来源:firebird.inc.php
示例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;
}
开发者ID:vakata,项目名称:database,代码行数:36,代码来源:Ibase.php
示例6: _setDbError
function _setDbError($query)
{
return $this->_setLastError(ibase_errcode(), ibase_errmsg(), $query);
}
开发者ID:saqar,项目名称:tc_aowow,代码行数:4,代码来源:Ibase.php
示例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;
}
开发者ID:floffel03,项目名称:pydio-core,代码行数:20,代码来源:DibiFirebirdDriver.php
示例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;
}
开发者ID:dalinhuang,项目名称:concourse,代码行数:20,代码来源:DbIbase.class.php
示例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;
}
开发者ID:JosefinaArayaTapia,项目名称:Capicua-Restobar,代码行数:69,代码来源:Firebird_3.php
示例10: _handleerror
function _handleerror()
{
$this->_errorMsg = ibase_errmsg();
}
开发者ID:kractos26,项目名称:orfeo,代码行数:4,代码来源:adodb-ibase.inc.php
示例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
}
开发者ID:mmendoza000,项目名称:freekore,代码行数:38,代码来源:db_firebird.php
示例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());
}
开发者ID:aldsdelram,项目名称:PUPNLPWebsite,代码行数:12,代码来源:ibase_driver.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:14,代码来源:metabase_ibase.php
示例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;
}
开发者ID:slrondon,项目名称:MikrotikCenter,代码行数:21,代码来源:firebird.php
示例15: _sql_error
/**
* return sql error array
* @access private
*/
function _sql_error()
{
return array('message' => @ibase_errmsg(), 'code' => @function_exists('ibase_errcode') ? @ibase_errcode() : '');
}
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:8,代码来源:firebird.php
示例16: rowCount
/**
* Returns the number of rows affected by the execution of the
* last INSERT, DELETE, or UPDATE statement executed by this
* statement object.
*
* @return int The number of rows affected.
* @throws Zend_Db_Statement_Exception
*/
public function rowCount()
{
if ($trans = $this->_adapter->getTransaction()) {
$num_rows = ibase_affected_rows($trans);
} else {
$num_rows = ibase_affected_rows($this->_adapter->getConnection());
}
if ($num_rows === false) {
/**
* @see Zend_Db_Adapter_Firebird_Exception
*/
require_once 'Zend/Db/Statement/Frebird/Exception.php';
throw new Zend_Db_Statement_Firebird_Exception(ibase_errmsg());
}
return $num_rows;
}
开发者ID:dalinhuang,项目名称:popo,代码行数:24,代码来源:Firebird.php
示例17: connect_check_db
//.........这里部分代码省略.........
$error[] = $lang['INST_ERR_PREFIX'];
}
}
// Make sure that the user has selected a sensible DBAL for the DBMS actually installed
switch ($dbms_details['DRIVER']) {
case 'mysqli':
if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<')) {
$error[] = $lang['INST_ERR_DB_NO_MYSQLI'];
}
break;
case 'sqlite':
if (version_compare(sqlite_libversion(), '2.8.2', '<')) {
$error[] = $lang['INST_ERR_DB_NO_SQLITE'];
}
break;
case 'firebird':
// check the version of FB, use some hackery if we can't get access to the server info
if ($db->service_handle !== false && function_exists('ibase_server_info')) {
$val = @ibase_server_info($db->service_handle, IBASE_SVC_SERVER_VERSION);
preg_match('#V([\\d.]+)#', $val, $match);
if ($match[1] < 2) {
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
}
$db_info = @ibase_db_info($db->service_handle, $dbname, IBASE_STS_HDR_PAGES);
preg_match('/^\\s*Page size\\s*(\\d+)/m', $db_info, $regs);
$page_size = intval($regs[1]);
if ($page_size < 8192) {
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS'];
}
} else {
$sql = "SELECT *\n\t\t\t\t\t\tFROM RDB{$FUNCTIONS}\n\t\t\t\t\t\tWHERE RDB{$SYSTEM_FLAG} IS NULL\n\t\t\t\t\t\t\tAND RDB{$FUNCTION_NAME} = 'CHAR_LENGTH'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// if its a UDF, its too old
if ($row) {
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
} else {
$sql = 'SELECT 1 FROM RDB$DATABASE
WHERE BIN_AND(10, 1) = 0';
$result = $db->sql_query($sql);
if (!$result) {
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
}
$db->sql_freeresult($result);
}
// Setup the stuff for our random table
$char_array = array_merge(range('A', 'Z'), range('0', '9'));
$char_len = mt_rand(7, 9);
$char_array_len = sizeof($char_array) - 1;
$final = '';
for ($i = 0; $i < $char_len; $i++) {
$final .= $char_array[mt_rand(0, $char_array_len)];
}
// Create some random table
$sql = 'CREATE TABLE ' . $final . " (\n\t\t\t\t\t\tFIELD1 VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,\n\t\t\t\t\t\tFIELD2 INTEGER DEFAULT 0 NOT NULL);";
$db->sql_query($sql);
// Create an index that should fail if the page size is less than 8192
$sql = 'CREATE INDEX ' . $final . ' ON ' . $final . '(FIELD1, FIELD2);';
$db->sql_query($sql);
if (ibase_errmsg() !== false) {
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS'];
} else {
// Kill the old table
$db->sql_query('DROP TABLE ' . $final . ';');
}
unset($final);
}
break;
case 'oracle':
if ($unicode_check) {
$sql = "SELECT *\n\t\t\t\t\t\tFROM NLS_DATABASE_PARAMETERS\n\t\t\t\t\t\tWHERE PARAMETER = 'NLS_RDBMS_VERSION'\n\t\t\t\t\t\t\tOR PARAMETER = 'NLS_CHARACTERSET'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$stats[$row['parameter']] = $row['value'];
}
$db->sql_freeresult($result);
if (version_compare($stats['NLS_RDBMS_VERSION'], '9.2', '<') && $stats['NLS_CHARACTERSET'] !== 'UTF8') {
$error[] = $lang['INST_ERR_DB_NO_ORACLE'];
}
}
break;
case 'postgres':
if ($unicode_check) {
$sql = "SHOW server_encoding;";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8') {
$error[] = $lang['INST_ERR_DB_NO_POSTGRES'];
}
}
break;
}
}
if ($error_connect && (!isset($error) || !sizeof($error))) {
return true;
}
return false;
}
开发者ID:eyumay,项目名称:ju.ejhs,代码行数:101,代码来源:functions_install.php
示例18: GetSequenceCurrentValue
function GetSequenceCurrentValue(&$db, $name, &$value)
{
if (($result = $db->Query("SELECT GEN_ID({$name},0) as the_value FROM RDB\$DATABASE ")) == 0) {
return $db->SetError("Get sequence current value", ibase_errmsg());
}
$value = intval($db->FetchResult($result, 0, 0));
$db->FreeResult($result);
return 1;
}
开发者ID:BackupTheBerlios,项目名称:zvs,代码行数:9,代码来源:manager_ibase.php
示例19: error
/**
* 数据库错误信息
* 并显示当前的SQL语句
* @access public
* @return string
*/
public function error()
{
$this->error = ibase_errmsg();
if ('' != $this->queryStr) {
$this->error .= "\n [ SQL语句 ] : " . $this->queryStr;
}
trace($this->error, '', 'ERR');
return $this->error;
}
开发者ID:szwork2013,项目名称:distribution,代码行数:15,代码来源:DbIbase.class.php
示例20: execute
public function execute($sql, $data = array())
{
if (!$this->is_connected()) {
$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":
case "resource":
$data[$i] = serialize($data[$i]);
break;
}
}
array_unshift($data, $sql);
$temp = call_user_func_array("ibase_execute", $data);
if (!$temp) {
throw new Exception('Could not execute query : ' . ibase_errmsg() . ' <' . $sql . '>');
}
$this->aff = ibase_affected_rows($this->lnk);
return $temp;
}
开发者ID:roychoo,项目名称:jstree,代码行数:32,代码来源:class.db.php
注:本文中的ibase_errmsg函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论