標籤:metadata rom 添加 tin const ack 數組 結果 ado
PDO(PHP Data Objects)是一個“資料庫訪問抽象層”,作用是統一各種資料庫的提供者,與mysql和mysqli的函數庫相比,PDO讓跨資料庫的使用更具有親和力;與ADODB和MDB2相比,PDO更高效。目前而言,實現“資料庫抽象層”任重而道遠,使用PDO這樣的“資料庫訪問抽象層”是一個不錯的選擇。
PHP 6將預設使用PDO來處理資料庫,把所有的資料庫擴充移到了PECL
PDO->beginTransaction() — 標明復原起始點
PDO->commit() — 標明復原結束點,並執行SQL
PDO->__construct() — 建立一個PDO連結資料庫的執行個體
PDO->errorCode() — 擷取錯誤碼
PDO->errorInfo() — 擷取錯誤的資訊
PDO->exec() — 處理一條SQL語句,並返回所影響的條目數
PDO->getAttribute() — 擷取一個“資料庫連接對象”的屬性
PDO->getAvailableDrivers() — 擷取有效PDO磁碟機名稱
PDO->lastInsertId() — 擷取寫入的最後一條資料的主索引值
PDO->prepare() — 產生一個“查詢對象”
PDO->query() — 處理一條SQL語句,並返回一個“PDOStatement”
PDO->quote() — 為某個SQL中的字串添加引號
PDO->rollBack() — 執行復原
PDO->setAttribute() — 為一個“資料庫連接對象”設定屬性
PDOStatement->bindColumn() — 將PHP的變數綁定到資料庫中的列
PDOStatement->bindParam() — 綁定一個指定參數的變數名稱
PDOStatement->bindValue() — 將一個參數值綁定
PDOStatement->closeCursor() — 關閉遊標,使聲明再次被運行。
PDOStatement->columnCount() — 返回列數的結果集
PDOStatement->errorCode() — Fetch the SQLSTATE associated with the last operation on the statement handle
PDOStatement->errorInfo() — Fetch extended error information associated with the last operation on the statement handle
PDOStatement->execute() — 執行一個準備好的查詢對象
PDOStatement->fetch() — 擷取下一行的結果集
PDOStatement->fetchAll() — 返回一個數組包含所有的結果集列
PDOStatement->fetchColumn() — Returns a single column from the next row of a result set
PDOStatement->fetchObject() — Fetches the next row and returns it as an object.
PDOStatement->getAttribute() — Retrieve a statement attribute
PDOStatement->getColumnMeta() — Returns metadata for a column in a result set
PDOStatement->nextRowset() — Advances to the next rowset in a multi-rowset statement handle
PDOStatement->rowCount() — 由過去的SQL語句返回行數
PDOStatement->setAttribute() — 聲明屬性集
PDOStatement->setFetchMode() — Set the default fetch mode for this statement
PHP – PDO函數簡介