PDO
Version från den 22 december 2024 kl. 07.46 av Admin (diskussion | bidrag)
PHP Data Objects (PDO)
PDO är en lättviktig och konsekvent gränssnitt för att komma åt databaser i PHP. Det erbjuder en databasabstraktionslager som gör att samma funktioner kan användas för olika databaser.
Innehåll
- Introduction
- Installing/Configuring
- Predefined Constants
- Connections and Connection management
- Transactions and auto-commit
- Prepared statements and stored procedures
- Errors and error handling
- Large Objects (LOBs)
- PDO — The PDO class
- PDO::beginTransaction() — Initiates a transaction
- PDO::commit() — Commits a transaction
- PDO::connect() — Connect to a database and return a PDO subclass for drivers that support it
- PDO::__construct() — Creates a PDO instance representing a connection to a database
- PDO::errorCode() — Fetch the SQLSTATE associated with the last operation on the database handle
- PDO::errorInfo() — Fetch extended error information associated with the last operation on the database handle
- PDO::exec() — Execute an SQL statement and return the number of affected rows
- PDO::getAttribute() — Retrieve a database connection attribute
- PDO::getAvailableDrivers() — Return an array of available PDO drivers
- PDO::inTransaction() — Checks if inside a transaction
- PDO::lastInsertId() — Returns the ID of the last inserted row or sequence value
- PDO::prepare() — Prepares a statement for execution and returns a statement object
- PDO::query() — Prepares and executes an SQL statement without placeholders
- PDO::quote() — Quotes a string for use in a query
- PDO::rollBack() — Rolls back a transaction
- PDO::setAttribute() — Set an attribute
- PDOStatement — The PDOStatement class
- 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::debugDumpParams() — Dump an SQL prepared command
- 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() — Fetches the remaining rows from a result set
- 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::getIterator() — Gets result set iterator
- PDOStatement::nextRowset() — 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
- PDORow — The PDORow class
- PDOException — The PDOException class
- PDO Drivers
- CUBRID (PDO) — CUBRID Functions (PDO_CUBRID)
- MS SQL Server (PDO) — Microsoft SQL Server and Sybase Functions (PDO_DBLIB)
- Pdo\Dblib — The Pdo\Dblib class
- Firebird (PDO) — Firebird Functions (PDO_FIREBIRD)
- Pdo\Firebird — The Pdo\Firebird class
- IBM (PDO) — IBM Functions (PDO_IBM)
- Informix (PDO) — Informix Functions (PDO_INFORMIX)
- MySQL (PDO) — MySQL Functions (PDO_MYSQL)
- Pdo\Mysql — The Pdo\Mysql class
- MS SQL Server (PDO) — Microsoft SQL Server Functions (PDO_SQLSRV)
- Oracle (PDO) — Oracle Functions (PDO_OCI)
- ODBC and DB2 (PDO) — ODBC and DB2 Functions (PDO_ODBC)
- Pdo\Odbc — The Pdo\Odbc class
- PostgreSQL (PDO) — PostgreSQL Functions (PDO_PGSQL)
- Pdo\Pgsql — The Pdo\Pgsql class
- SQLite (PDO) — SQLite Functions (PDO_SQLITE)
- Pdo\Sqlite — The Pdo\Sqlite class
Sidslut
Orginalhemsidan på Engelska :https://www.php.net/manual/en/book.pdo.php
PHP
Funktioner
Funktionsreferens
Databas-tillägg
Det här är en maskinöversättning av PHP-manualen till svenska. Om du hittar fel är vi tacksamma om du rapporterar dem via formuläret som finns på
https://www.linux.se/kontaka-linux-se/
Tack till Huddinge Datorhjälp som har sponsrat Linux.se med webbhotell.