PDO is more efficient compared to ADODB and MDB2. At present, there is a long way to go to implement the "database abstraction layer". Using a "database access abstraction layer" such as PDO is a good choice.
PDO->beginTransaction() — Marks the starting point of rollback
PDO->commit() — Marks the end point of rollback and executes SQL
PDO->__construct() — Creates a PDO Instance of linked database
PDO->errorCode() — Get error code
PDO->errorInfo() — Get error information
PDO->exec() — Process a SQL statement and Returns the number of entries affected
PDO->getAttribute() — Gets the attributes of a "Database Connection Object"
PDO->getAvailableDrivers() — Gets the valid PDO driver name
PDO-> lastInsertId() — Get the primary key value of the last piece of data written
PDO->prepare() — Generate a “query object”
PDO->query() — Process a SQL statement and return A "PDOStatement"
PDO->quote() — Add quotes to a string in a SQL
PDO->rollBack() — Perform rollback
PDO->setAttribute() — Set properties for a "database connection object"
PDOStatement->bindColumn() — Bind a column to a PHP variable
PDOStatement->bindParam() — Binds a parameter to the specified variable name
PDOStatement->bindValue() — Binds a value to a parameter
PDOStatement->closeCursor() — Closes the cursor, enabling the statement to be executed again.
PDOStatement->columnCount() — Returns the number of columns in the result set
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() — Executes a prepared statement
PDOStatement->fetch() — Fetches the next row from a result set
PDOStatement->fetchAll() — Returns an array containing all of the result set rows
PDOStatement->fetchColumn() — Returns a single column from the next row of a result set
PDOStatement->fetchObject() — Fetches the next row and returns it
PDOStatement->getAttribute() — Retrieve a statement attribute
PDOStatement->getColumnMeta() — Returns metadata for a column in a result set Advances to the next rowset in a multi-rowset statement handle
PDOStatement->rowCount() — Returns the number of rows affected by the last SQL statement
PDOStatement->setAttribute() — Set a statement attribute
PDOStatement->setFetchMode() — Set the default fetch mode for this statement
As can be seen from the function list, the operation is based on different objects. "PDO" represents a database connection object (generated by new PDO). "PDOStatement" represents a query object (produced by PDO->query()) or a result set object (produced by PDO->prepare()).
An example of "Database Connection Object", returning "PDO":