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


PHP resource::lastErrorMsg方法代码示例

本文整理汇总了PHP中resource::lastErrorMsg方法的典型用法代码示例。如果您正苦于以下问题:PHP resource::lastErrorMsg方法的具体用法?PHP resource::lastErrorMsg怎么用?PHP resource::lastErrorMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在resource的用法示例。


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

示例1: copyCellCollection

    /**
     * Clone the cell collection
     *
     * @param    PHPExcel_Worksheet $parent The new worksheet
     *
     * @return    void
     */
    public function copyCellCollection(PHPExcel_Worksheet $parent)
    {
        $this->_currentCellIsDirty;
        $this->_storeData();
        //	Get a new id for the new table name
        $tableName = str_replace('.', '_', $this->_getUniqueID());
        if (!$this->_DBHandle->exec('CREATE TABLE kvp_' . $tableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)
		                                       AS SELECT * FROM kvp_' . $this->_TableName)) {
            throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
        }
        //	Copy the existing cell cache file
        $this->_TableName = $tableName;
    }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:20,代码来源:SQLite3.php

示例2: __construct

 /**
  * Initialise this new cell collection
  *
  * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
  */
 public function __construct(PHPExcel_Worksheet $parent)
 {
     parent::__construct($parent);
     if (is_null($this->_DBHandle)) {
         $this->_TableName = str_replace('.', '_', $this->_getUniqueID());
         $_DBName = ':memory:';
         $this->_DBHandle = new SQLite3($_DBName);
         if ($this->_DBHandle === false) {
             throw new Exception($this->_DBHandle->lastErrorMsg());
         }
         if (!$this->_DBHandle->exec('CREATE TABLE kvp_' . $this->_TableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) {
             throw new Exception($this->_DBHandle->lastErrorMsg());
         }
     }
 }
开发者ID:JaeHoYun,项目名称:generatedata,代码行数:20,代码来源:SQLite3.php

示例3: moveCell

 /**
  * Move a cell object from one address to another
  *
  * @param	string		$fromAddress	Current address of the cell to move
  * @param	string		$toAddress		Destination address of the cell to move
  * @return	boolean
  */
 public function moveCell($fromAddress, $toAddress)
 {
     if ($fromAddress === $this->_currentObjectID) {
         $this->_currentObjectID = $toAddress;
     }
     $query = "DELETE FROM kvp_" . $this->_TableName . " WHERE id = '" . $toAddress . "'";
     $result = $this->_DBHandle->exec($query);
     if ($result === false) {
         throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
     }
     $query = "UPDATE kvp_" . $this->_TableName . " SET id = '" . $toAddress . "' WHERE id = '" . $fromAddress . "'";
     $result = $this->_DBHandle->exec($query);
     if ($result === false) {
         throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
     }
     return true;
 }
开发者ID:ahmatjan,项目名称:OpenCart-Overclocked,代码行数:24,代码来源:SQLite.php

示例4: __construct

 /**
  * Initialise this new cell collection
  *
  * @param	PHPExcel_Worksheet	$parent		The worksheet for this cell collection
  */
 public function __construct(PHPExcel_Worksheet $parent)
 {
     parent::__construct($parent);
     if (is_null($this->_DBHandle)) {
         $this->_TableName = str_replace('.', '_', $this->_getUniqueID());
         $_DBName = ':memory:';
         $this->_DBHandle = new SQLite3($_DBName);
         if ($this->_DBHandle === false) {
             throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
         }
         if (!$this->_DBHandle->exec('CREATE TABLE kvp_' . $this->_TableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) {
             throw new PHPExcel_Exception($this->_DBHandle->lastErrorMsg());
         }
     }
     $this->_selectQuery = $this->_DBHandle->prepare("SELECT value FROM kvp_" . $this->_TableName . " WHERE id = :id");
     $this->_insertQuery = $this->_DBHandle->prepare("INSERT OR REPLACE INTO kvp_" . $this->_TableName . " VALUES(:id,:data)");
     $this->_updateQuery = $this->_DBHandle->prepare("UPDATE kvp_" . $this->_TableName . " SET id=:toId WHERE id=:fromId");
     $this->_deleteQuery = $this->_DBHandle->prepare("DELETE FROM kvp_" . $this->_TableName . " WHERE id = :id");
 }
开发者ID:Troutzorz,项目名称:csapp,代码行数:24,代码来源:SQLite3.php

示例5: query

 /**
  * 直接查询Sql
  *
  * @param String $SQL
  * @return Mix
  */
 function query($sql)
 {
     if (!$this->conn) {
         $this->connect();
     }
     if (strtolower(substr(ltrim($sql), 0, 5)) == 'alter') {
         $queryparts = preg_split("/[\\s]+/", $sql, 4, PREG_SPLIT_NO_EMPTY);
         $tablename = $queryparts[2];
         $alterdefs = $queryparts[3];
         $result = $this->alterTable($tablename, $alterdefs);
     } else {
         if ($this->type == "SQLite2") {
             $result = sqlite_query($sql, $this->conn);
         } else {
             $result = $this->conn->query($sql);
         }
     }
     if (!$result) {
         if ($this->type == "SQLite2") {
             $this->lasterr = sqlite_last_error($this->conn);
             $this->lasterrcode = sqlite_error_string($this->lasterr);
         } elseif ($this->type == "SQLite3") {
             $this->lasterr = $this->conn->lastErrorCode();
             $this->lasterrcode = $this->conn->lastErrorMsg();
         } elseif ($this->type == 'PDO') {
             $this->lasterr = $this->conn->errorCode();
             $this->lasterrcode = implode(',', $this->conn->errorInfo());
         }
         if ($this->_transflag) {
             $this->_transErrors[]['sql'] = $sql;
             $this->_transErrors[]['errcode'] = $this->lasterrcode;
             $this->_transErrors[]['err'] = $this->lasterr;
         } else {
             exit('SQL:' . $sql . ' ERROR_INFO:' . $this->lasterrcode . ',' . $this->lasterr);
             return false;
         }
     } else {
         $this->query_num++;
         $this->lastResult = $result;
         return $result;
     }
 }
开发者ID:jorkin,项目名称:meiupic,代码行数:48,代码来源:sqlite.php

示例6: errorInfo

 public function errorInfo()
 {
     return $this->dbh->lastErrorMsg();
 }
开发者ID:joshuacoddingyou,项目名称:php,代码行数:4,代码来源:SQLite3Connection.php


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