当前位置: 首页>>代码示例>>PHP>>正文


PHP sqlite_last_error函数代码示例

本文整理汇总了PHP中sqlite_last_error函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlite_last_error函数的具体用法?PHP sqlite_last_error怎么用?PHP sqlite_last_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sqlite_last_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _catch

 function _catch($msg = "")
 {
     if (!($this->error = sqlite_error_string(sqlite_last_error($this->conn)))) {
         return true;
     }
     $this->error($msg . "<br>{$this->query}\n {$this->error}");
 }
开发者ID:jvinet,项目名称:pronto,代码行数:7,代码来源:sqlite.php

示例2: _set_stmt_error

 protected function _set_stmt_error($state = null, $mode = PDO::ERRMODE_SILENT, $func = '')
 {
     $errno = sqlite_last_error($this->_link);
     if ($state === null) {
         $state = 'HY000';
     }
     $this->_set_error($errno, sqlite_error_string($errno), $state, $mode, $func);
 }
开发者ID:Deepab23,项目名称:clinic,代码行数:8,代码来源:sqlite2_statement.php

示例3: real_execute_sql

 public function real_execute_sql($sql)
 {
     $result_set_handle = sqlite_query($this->connection_handle, $sql);
     if (!$result_set_handle) {
         throw new AnewtDatabaseQueryException('SQLite error: %s', sqlite_error_string(sqlite_last_error($this->connection_handle)));
     }
     return new AnewtDatabaseResultSetSQLite($sql, $this->connection_handle, $result_set_handle);
 }
开发者ID:jijkoun,项目名称:ssscrape,代码行数:8,代码来源:backend-sqlite.lib.php

示例4: SqliteResultSet

 /**
  * Constructs a new SqliteResultSet
  *
  * \param $sql
  *   The sql query to execute.
  *
  * \param $backend
  *   A reference to the used backend.
  */
 function SqliteResultSet($sql, &$backend)
 {
     assert('is_string($sql)');
     $this->sql = $sql;
     $this->backend =& $backend;
     $this->rs = sqlite_query($this->backend->handle, $sql) or trigger_error(sprintf('Query failed (%s)', sqlite_error_string(sqlite_last_error($this->backend->handle))), E_USER_ERROR);
     $this->rows_affected = sqlite_changes($this->backend->handle);
 }
开发者ID:jijkoun,项目名称:ssscrape,代码行数:17,代码来源:resultset.lib.php

示例5: _error_handler

 function _error_handler(array $errarray, $query = '')
 {
     $err = sprintf('%s on line %d.', $errarray[0], $errarray[1]);
     $errno = sqlite_last_error($this->con);
     if (defined('DEBUG') && DEBUG) {
         $err .= sprintf(PHP_EOL . "Description: #%d: %s" . PHP_EOL . "SQL: %s", $errno, sqlite_error_string($errno), $query);
     }
     throw new RuntimeException($err, $errno);
 }
开发者ID:Kennyl,项目名称:pixmicat,代码行数:9,代码来源:pio.sqlite.php

示例6: query

 /**
  * query 
  * 
  * @param mixed $query 
  * @access public
  * @return mixed
  * @throws AdapterException
  */
 public function query($query)
 {
     $handle = @sqlite_query($query, $this->_dbHandle);
     if (!$handle) {
         $errorCode = sqlite_last_error($this->_dbHandle);
         throw new AdapterException(sqlite_error_string($errorCode), $errorCode);
     }
     return $handle;
 }
开发者ID:wangjunbo,项目名称:framework,代码行数:17,代码来源:SQLite.php

示例7: query

 public function query($sql)
 {
     LogMaster::log($sql);
     $res = sqlite_query($this->connection, $sql);
     if ($res === false) {
         throw new Exception("SQLLite - sql execution failed\n" . sqlite_error_string(sqlite_last_error($this->connection)));
     }
     return $res;
 }
开发者ID:neohusky,项目名称:demo,代码行数:9,代码来源:db_sqlite.php

示例8: query

 /**
  * 执行数据库查询
  *
  * @param string $query
  * @param mixed $handle
  * @param int $op
  * @param null $action
  * @return resource|SQLiteResult
  * @throws Typecho_Db_Query_Exception
  */
 public function query($query, $handle, $op = Typecho_Db::READ, $action = NULL)
 {
     if ($resource = @sqlite_query($query instanceof Typecho_Db_Query ? $query->__toString() : $query, $handle)) {
         return $resource;
     }
     /** 数据库异常 */
     $errorCode = sqlite_last_error($this->_dbHandle);
     throw new Typecho_Db_Query_Exception(sqlite_error_string($errorCode), $errorCode);
 }
开发者ID:hongweipeng,项目名称:cool_blog,代码行数:19,代码来源:SQLite.php

示例9: __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)
 {
     $resource = $connection->get_resource();
     $command = @sqlite_query($resource, $sql);
     if ($command === FALSE) {
         throw new Throwable_SQL_Exception('Message: Failed to query SQL statement. Reason: :reason', array(':reason' => sqlite_error_string(sqlite_last_error($resource))));
     }
     $this->command = $command;
     $this->record = FALSE;
 }
开发者ID:ruslankus,项目名称:invoice-crm,代码行数:20,代码来源:Standard.php

示例10: safe_query

function safe_query($query)
{
    $res = sqlite_query($query, sqlite_r);
    if (!$res) {
        $err_code = sqlite_last_error(sqlite_r);
        printf("Query Failed %d:%s\n", $err_code, sqlite_error_string($err_code));
        exit;
    }
    return $res;
}
开发者ID:SandyS1,项目名称:presentations,代码行数:10,代码来源:database_final.php

示例11: query

 function query($sql)
 {
     global $page;
     if (!($this->result = sqlite_query($this->dbres, $sql))) {
         print "Query failed, <span style=\"color: blue;\"><pre>{$sql}</pre></style>\n";
         print sqlite_error_string(sqlite_last_error($this->dbres));
         $page->footer();
         exit;
     }
 }
开发者ID:jimmac,项目名称:original,代码行数:10,代码来源:db.class.inc.php

示例12: DriverSqliteExec

function DriverSqliteExec($conn, $sql, $check_result = true)
{
    if ($check_result) {
        if (!($result = sqlite_query($conn, $sql))) {
            throw new lmbDbException('SQLite error happened: ' . sqlite_error_string(sqlite_last_error($conn)));
        }
    } else {
        $result = @sqlite_query($conn, $sql);
    }
    return $result;
}
开发者ID:knevcher,项目名称:limb,代码行数:11,代码来源:fixture.inc.php

示例13: error

 public function error($status = '')
 {
     $error = sqlite_last_error($this->connection);
     if ($status = 'show') {
         return sqlite_error_string($error);
     } elseif ($error != 0) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:eodivision,项目名称:eoCMS,代码行数:11,代码来源:SQLite.php

示例14: getError

 function getError($errorCode = null)
 {
     if (!$this->error) {
         $this->error = sqlite_last_error($this->connId);
     }
     if ($errorCode == null) {
         $errorCode = $this->error;
     }
     $this->errorMessage = sqlite_error_string($errorCode);
     return $this->errorMessage;
 }
开发者ID:ve3sjk,项目名称:45Farms-YieldBuddy-Merged,代码行数:11,代码来源:sqlite_2.class.php

示例15: initTables

 /**
  * @throws SQLException
  * @return void
  */
 protected function initTables()
 {
     include_once 'creole/drivers/sqlite/metadata/SQLiteTableInfo.php';
     $sql = "SELECT name FROM sqlite_master WHERE type='table' UNION ALL SELECT name FROM sqlite_temp_master WHERE type='table' ORDER BY name;";
     $result = sqlite_query($this->dblink, $sql);
     if (!$result) {
         throw new SQLException("Could not list tables", sqlite_last_error($this->dblink));
     }
     while ($row = sqlite_fetch_array($result)) {
         $this->tables[strtoupper($row[0])] = new SQLiteTableInfo($this, $row[0]);
     }
 }
开发者ID:rodrigoprestesmachado,项目名称:whiteboard,代码行数:16,代码来源:SQLiteDatabaseInfo.php


注:本文中的sqlite_last_error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。