當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。