PDOException from your own code. * @see https://php.net/manual/en/language.exceptions.php Exceptions in PHP * @link https://php.net/manual/en/class.pdoexception.php */ class PDOException extends RuntimeException { #[LanguageLevelTypeAware(['8.1' => 'array|null'], default: '')] public $errorInfo; protected $code; } /** * Represents a connection between PHP and a database server. * @link https://php.net/manual/en/class.pdo.php */ class PDO { /** * Represents the SQL NULL data type. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-null */ public const PARAM_NULL = 0; /** * Represents the SQL INTEGER data type. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-int */ public const PARAM_INT = 1; /** * Represents the SQL CHAR, VARCHAR, or other string data type. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str */ public const PARAM_STR = 2; /** * Represents the SQL large object data type. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-lob */ public const PARAM_LOB = 3; /** * Represents a recordset type. Not currently supported by any drivers. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-stmt */ public const PARAM_STMT = 4; /** * Represents a boolean data type. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-bool */ public const PARAM_BOOL = 5; /** * Flag to denote a string uses the national character set. * @since 7.2 * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str-natl */ public const PARAM_STR_NATL = 1073741824; /** * Flag to denote a string uses the regular character set. * @since 7.2 * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str-char */ public const PARAM_STR_CHAR = 536870912; /** * Sets the default string parameter type, this can be one of PDO::PARAM_STR_NATL and PDO::PARAM_STR_CHAR. * @since 7.2 * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-default-str-param */ public const ATTR_DEFAULT_STR_PARAM = 21; /** * Specifies that a function created with PDO::sqliteCreateFunction() is deterministic, i.e. it always returns the same result given the same inputs within a single SQL statement. * @since 7.1.4 * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.sqlite-deterministic */ public const SQLITE_DETERMINISTIC = 2048; /** * @since 7.3 */ public const SQLITE_OPEN_READONLY = 1; /** * @since 7.3 */ public const SQLITE_OPEN_READWRITE = 2; /** * @since 7.3 */ public const SQLITE_OPEN_CREATE = 4; /** * @since 7.3 */ public const SQLITE_ATTR_OPEN_FLAGS = 1000; /** * Specifies that the parameter is an INOUT parameter for a stored * procedure. You must bitwise-OR this value with an explicit * PDO::PARAM_* data type. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-input-output */ public const PARAM_INPUT_OUTPUT = 2147483648; /** * Allocation event * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-alloc */ public const PARAM_EVT_ALLOC = 0; /** * Deallocation event * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-free */ public const PARAM_EVT_FREE = 1; /** * Event triggered prior to execution of a prepared statement. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-exec-pre */ public const PARAM_EVT_EXEC_PRE = 2; /** * Event triggered subsequent to execution of a prepared statement. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-exec-post */ public const PARAM_EVT_EXEC_POST = 3; /** * Event triggered prior to fetching a result from a resultset. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-fetch-pre */ public const PARAM_EVT_FETCH_PRE = 4; /** * Event triggered subsequent to fetching a result from a resultset. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-fetch-post */ public const PARAM_EVT_FETCH_POST = 5; /** * Event triggered during bound parameter registration * allowing the driver to normalize the parameter name. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-normalize */ public const PARAM_EVT_NORMALIZE = 6; /** * Specifies that the fetch method shall return each row as an object with * variable names that correspond to the column names returned in the result * set. PDO::FETCH_LAZY creates the object variable names as they are accessed. * Not valid inside PDOStatement::fetchAll. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-lazy */ public const FETCH_LAZY = 1; /** * Specifies that the fetch method shall return each row as an array indexed * by column name as returned in the corresponding result set. If the result * set contains multiple columns with the same name, * PDO::FETCH_ASSOC returns * only a single value per column name. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-assoc */ public const FETCH_ASSOC = 2; /** * Specifies that the fetch method shall return each row as an array indexed * by column number as returned in the corresponding result set, starting at * column 0. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-num */ public const FETCH_NUM = 3; /** * Specifies that the fetch method shall return each row as an array indexed * by both column name and number as returned in the corresponding result set, * starting at column 0. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-both */ public const FETCH_BOTH = 4; /** * Specifies that the fetch method shall return each row as an object with * property names that correspond to the column names returned in the result * set. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-obj */ public const FETCH_OBJ = 5; /** * Specifies that the fetch method shall return TRUE and assign the values of * the columns in the result set to the PHP variables to which they were * bound with the PDOStatement::bindParam or * PDOStatement::bindColumn methods. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-bound */ public const FETCH_BOUND = 6; /** * Specifies that the fetch method shall return only a single requested * column from the next row in the result set. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-column */ public const FETCH_COLUMN = 7; /** * Specifies that the fetch method shall return a new instance of the * requested class, mapping the columns to named properties in the class. * The magic * __set * method is called if the property doesn't exist in the requested class * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-class */ public const FETCH_CLASS = 8; /** * Specifies that the fetch method shall update an existing instance of the * requested class, mapping the columns to named properties in the class. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-into */ public const FETCH_INTO = 9; /** * Allows completely customize the way data is treated on the fly (only * valid inside PDOStatement::fetchAll). * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-func */ public const FETCH_FUNC = 10; /** * Group return by values. Usually combined with * PDO::FETCH_COLUMN or * PDO::FETCH_KEY_PAIR. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-group */ public const FETCH_GROUP = 65536; /** * Fetch only the unique values. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-unique */ public const FETCH_UNIQUE = 196608; /** * Fetch a two-column result into an array where the first column is a key and the second column * is the value. * @since 5.2.3 * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-key-pair */ public const FETCH_KEY_PAIR = 12; /** * Determine the class name from the value of first column. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-classtype */ public const FETCH_CLASSTYPE = 262144; /** * As PDO::FETCH_INTO but object is provided as a serialized string. * Available since PHP 5.1.0. Since PHP 5.3.0 the class constructor is never called if this * flag is set. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-serialize */ public const FETCH_SERIALIZE = 524288; /** * Call the constructor before setting properties. * @since 5.2.0 * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-props-late */ public const FETCH_PROPS_LATE = 1048576; /** * Specifies that the fetch method shall return each row as an array indexed * by column name as returned in the corresponding result set. If the result * set contains multiple columns with the same name, * PDO::FETCH_NAMED returns * an array of values per column name. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-named */ public const FETCH_NAMED = 11; /** * If this value is FALSE, PDO attempts to disable autocommit so that the * connection begins a transaction. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-autocommit */ public const ATTR_AUTOCOMMIT = 0; /** * Setting the prefetch size allows you to balance speed against memory * usage for your application. Not all database/driver combinations support * setting of the prefetch size. A larger prefetch size results in * increased performance at the cost of higher memory usage. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-prefetch */ public const ATTR_PREFETCH = 1; /** * Sets the timeout value in seconds for communications with the database. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-timeout */ public const ATTR_TIMEOUT = 2; /** * @see https://php.net/manual/en/pdo.error-handling.php Errors and error handling * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-errmode */ public const ATTR_ERRMODE = 3; /** * This is a read only attribute; it will return information about the * version of the database server to which PDO is connected. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr- */ public const ATTR_SERVER_VERSION = 4; /** * This is a read only attribute; it will return information about the * version of the client libraries that the PDO driver is using. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-client-version */ public const ATTR_CLIENT_VERSION = 5; /** * This is a read only attribute; it will return some meta information about the * database server to which PDO is connected. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-server-info */ public const ATTR_SERVER_INFO = 6; public const ATTR_CONNECTION_STATUS = 7; /** * Force column names to a specific case specified by the PDO::CASE_* * constants. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-case */ public const ATTR_CASE = 8; /** * Get or set the name to use for a cursor. Most useful when using * scrollable cursors and positioned updates. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-cursor-name */ public const ATTR_CURSOR_NAME = 9; /** * Selects the cursor type. PDO currently supports either * PDO::CURSOR_FWDONLY and * PDO::CURSOR_SCROLL. Stick with * PDO::CURSOR_FWDONLY unless you know that you need a * scrollable cursor. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-cursor */ public const ATTR_CURSOR = 10; /** * Convert empty strings to SQL NULL values on data fetches. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-oracle-nulls */ public const ATTR_ORACLE_NULLS = 11; /** * Request a persistent connection, rather than creating a new connection. * @see https://php.net/manual/en/pdo.connections.php Connections and Connection Management * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-persistent */ public const ATTR_PERSISTENT = 12; /** * Sets the class name of which statements are returned as. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-statement-class */ public const ATTR_STATEMENT_CLASS = 13; /** * Prepend the containing table name to each column name returned in the * result set. The table name and column name are separated by a decimal (.) * character. Support of this attribute is at the driver level; it may not * be supported by your driver. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-fetch-table-names */ public const ATTR_FETCH_TABLE_NAMES = 14; /** * Prepend the containing catalog name to each column name returned in the * result set. The catalog name and column name are separated by a decimal * (.) character. Support of this attribute is at the driver level; it may * not be supported by your driver. * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-fetch-catalog-names */ public const ATTR_FETCH_CATALOG_NAMES = 15; /** * Returns the name of the driver. *
* using PDO::ATTR_DRIVER_NAME
*
* if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
* echo "Running on mysql; doing something mysql specific here\n";
* }
*
*
* Forcing queries to be buffered in mysql
*
* if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
* $stmt = $db->prepare('select * from foo',
* array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
* } else {
* die("my application only works with mysql; I should use \$stmt->fetchAll() instead");
* }
*
*
* Enable LOAD LOCAL INFILE. *
** Note, this constant can only be used in the driver_options * array when constructing a new database handle. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-local-infile */ public const MYSQL_ATTR_LOCAL_INFILE = 1001; /** ** Command to execute when connecting to the MySQL server. Will * automatically be re-executed when reconnecting. *
** Note, this constant can only be used in the driver_options * array when constructing a new database handle. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-init-command */ public const MYSQL_ATTR_INIT_COMMAND = 1002; /** ** Maximum buffer size. Defaults to 1 MiB. This constant is not supported when * compiled against mysqlnd. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-max-buffer-size */ public const MYSQL_ATTR_MAX_BUFFER_SIZE = 1005; /** ** Read options from the named option file instead of from * my.cnf. This option is not available if * mysqlnd is used, because mysqlnd does not read the mysql * configuration files. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-read-default-file */ public const MYSQL_ATTR_READ_DEFAULT_FILE = 1003; /** ** Read options from the named group from my.cnf or the * file specified with MYSQL_READ_DEFAULT_FILE. This option * is not available if mysqlnd is used, because mysqlnd does not read the mysql * configuration files. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-read-default-group */ public const MYSQL_ATTR_READ_DEFAULT_GROUP = 1004; /** ** Enable network communication compression. This is not supported when * compiled against mysqlnd. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-compress */ public const MYSQL_ATTR_COMPRESS = 1003; /** ** Perform direct queries, don't use prepared statements. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-direct-query */ public const MYSQL_ATTR_DIRECT_QUERY = 1004; /** ** Return the number of found (matched) rows, not the * number of changed rows. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-found-rows */ public const MYSQL_ATTR_FOUND_ROWS = 1005; /** ** Permit spaces after function names. Makes all functions * names reserved words. *
* @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ignore-space */ public const MYSQL_ATTR_IGNORE_SPACE = 1006; public const MYSQL_ATTR_SERVER_PUBLIC_KEY = 1012; /** ** The file path to the SSL key. *
* @since 5.3.7 * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-key */ public const MYSQL_ATTR_SSL_KEY = 1007; /** ** The file path to the SSL certificate. *
* @since 5.3.7 * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-cert */ public const MYSQL_ATTR_SSL_CERT = 1008; /** ** The file path to the SSL certificate authority. *
* @since 5.3.7 * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-ca */ public const MYSQL_ATTR_SSL_CA = 1009; /** ** The file path to the directory that contains the trusted SSL * CA certificates, which are stored in PEM format. *
* @since 5.3.7 * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-capath */ public const MYSQL_ATTR_SSL_CAPATH = 1010; /** ** A list of one or more permissible ciphers to use for SSL encryption, * in a format understood by OpenSSL. * For example: DHE-RSA-AES256-SHA:AES128-SHA *
* @since 5.3.7 * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-cipher */ public const MYSQL_ATTR_SSL_CIPHER = 1011; /** ** Disables multi query execution in both {@see PDO::prepare()} and {@see PDO::query()} when set to FALSE. *
** Note, this constant can only be used in the driver_options array when constructing a new database handle. *
* @since 5.5.21 * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-multi-statements */ public const MYSQL_ATTR_MULTI_STATEMENTS = 1013; /** ** Disables SSL peer verification when set to FALSE. *
* @since 7.0.18 * @since 7.1.4 * @link https://bugs.php.net/bug.php?id=71003 */ public const MYSQL_ATTR_SSL_VERIFY_SERVER_CERT = 1014; /** * @since 8.1 */ public const MYSQL_ATTR_LOCAL_INFILE_DIRECTORY = 1015; #[Deprecated("Use PDO::ATTR_EMULATE_PREPARES instead")] public const PGSQL_ASSOC = 1; /** * @removed 7.1 */ public const PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT = 1000; /** * @since 5.6 */ public const PGSQL_ATTR_DISABLE_PREPARES = 1000; public const PGSQL_BAD_RESPONSE = 5; public const PGSQL_BOTH = 3; public const PGSQL_TRANSACTION_IDLE = 0; public const PGSQL_TRANSACTION_ACTIVE = 1; public const PGSQL_TRANSACTION_INTRANS = 2; public const PGSQL_TRANSACTION_INERROR = 3; public const PGSQL_TRANSACTION_UNKNOWN = 4; public const PGSQL_CONNECT_ASYNC = 4; public const PGSQL_CONNECT_FORCE_NEW = 2; public const PGSQL_CONNECTION_AUTH_OK = 5; public const PGSQL_CONNECTION_AWAITING_RESPONSE = 4; public const PGSQL_CONNECTION_BAD = 1; public const PGSQL_CONNECTION_OK = 0; public const PGSQL_CONNECTION_MADE = 3; public const PGSQL_CONNECTION_SETENV = 6; public const PGSQL_CONNECTION_SSL_STARTUP = 7; public const PGSQL_CONNECTION_STARTED = 2; public const PGSQL_COMMAND_OK = 1; public const PGSQL_CONV_FORCE_NULL = 4; public const PGSQL_CONV_IGNORE_DEFAULT = 2; public const PGSQL_CONV_IGNORE_NOT_NULL = 8; public const PGSQL_COPY_IN = 4; public const PGSQL_COPY_OUT = 3; public const PGSQL_DIAG_CONTEXT = 87; public const PGSQL_DIAG_INTERNAL_POSITION = 112; public const PGSQL_DIAG_INTERNAL_QUERY = 113; public const PGSQL_DIAG_MESSAGE_DETAIL = 68; public const PGSQL_DIAG_MESSAGE_HINT = 72; public const PGSQL_DIAG_MESSAGE_PRIMARY = 77; public const PGSQL_DIAG_SEVERITY = 83; public const PGSQL_DIAG_SOURCE_FILE = 70; public const PGSQL_DIAG_SOURCE_FUNCTION = 82; public const PGSQL_DIAG_SOURCE_LINE = 76; public const PGSQL_DIAG_SQLSTATE = 67; public const PGSQL_DIAG_STATEMENT_POSITION = 80; public const PGSQL_DML_ASYNC = 1024; public const PGSQL_DML_EXEC = 512; public const PGSQL_DML_NO_CONV = 256; public const PGSQL_DML_STRING = 2048; public const PGSQL_DML_ESCAPE = 4096; public const PGSQL_EMPTY_QUERY = 0; public const PGSQL_ERRORS_DEFAULT = 1; public const PGSQL_ERRORS_TERSE = 0; public const PGSQL_ERRORS_VERBOSE = 2; public const PGSQL_FATAL_ERROR = 7; public const PGSQL_NONFATAL_ERROR = 6; public const PGSQL_NOTICE_ALL = 2; public const PGSQL_NOTICE_CLEAR = 3; public const PGSQL_NOTICE_LAST = 1; public const PGSQL_NUM = 2; public const PGSQL_POLLING_ACTIVE = 4; public const PGSQL_POLLING_FAILED = 0; public const PGSQL_POLLING_OK = 3; public const PGSQL_POLLING_READING = 1; public const PGSQL_POLLING_WRITING = 2; public const PGSQL_SEEK_CUR = 1; public const PGSQL_SEEK_END = 2; public const PGSQL_SEEK_SET = 0; public const PGSQL_STATUS_LONG = 1; public const PGSQL_STATUS_STRING = 2; public const PGSQL_TUPLES_OK = 2; public const SQLSRV_TXN_READ_UNCOMMITTED = "READ_UNCOMMITTED"; public const SQLSRV_TXN_READ_COMMITTED = "READ_COMMITTED"; public const SQLSRV_TXN_REPEATABLE_READ = "REPEATABLE_READ"; public const SQLSRV_TXN_SNAPSHOT = "SNAPSHOT"; public const SQLSRV_TXN_SERIALIZABLE = "SERIALIZABLE"; public const SQLSRV_ENCODING_BINARY = 2; public const SQLSRV_ENCODING_SYSTEM = 3; public const SQLSRV_ENCODING_UTF8 = 65001; public const SQLSRV_ENCODING_DEFAULT = 1; public const SQLSRV_ATTR_ENCODING = 1000; public const SQLSRV_ATTR_QUERY_TIMEOUT = 1001; public const SQLSRV_ATTR_DIRECT_QUERY = 1002; public const SQLSRV_ATTR_CURSOR_SCROLL_TYPE = 1003; public const SQLSRV_ATTR_CLIENT_BUFFER_MAX_KB_SIZE = 1004; public const SQLSRV_ATTR_FETCHES_NUMERIC_TYPE = 1005; public const SQLSRV_ATTR_FETCHES_DATETIME_TYPE = 1006; public const SQLSRV_ATTR_FORMAT_DECIMALS = 1007; public const SQLSRV_ATTR_DECIMAL_PLACES = 1008; public const SQLSRV_ATTR_DATA_CLASSIFICATION = 1009; public const SQLSRV_PARAM_OUT_DEFAULT_SIZE = -1; public const SQLSRV_CURSOR_KEYSET = 1; public const SQLSRV_CURSOR_DYNAMIC = 2; public const SQLSRV_CURSOR_STATIC = 3; public const SQLSRV_CURSOR_BUFFERED = 42; /** * @since 7.4 */ public const SQLITE_ATTR_READONLY_STATEMENT = 1001; /** * @since 7.4 */ public const SQLITE_ATTR_EXTENDED_RESULT_CODES = 1002; /** * Provides a way to specify the action on the database session. * @since 7.2.16 * @since 7.3.3 */ public const OCI_ATTR_ACTION = 1000; /** * Provides a way to specify the client info on the database session. * @since 7.2.16 * @since 7.3.3 */ public const OCI_ATTR_CLIENT_INFO = 1001; /** * Provides a way to specify the client identifier on the database session. * @since 7.2.16 * @since 7.3.3 */ public const OCI_ATTR_CLIENT_IDENTIFIER = 1002; /** * Provides a way to specify the module on the database session. * @since 7.2.16 * @since 7.3.3 */ public const OCI_ATTR_MODULE = 1003; /** * The number of milliseconds to wait for individual round trips to the database to complete before timing out. * @since 8.0 */ public const OCI_ATTR_CALL_TIMEOUT = 1004; /** * Sets the date format. */ public const FB_ATTR_DATE_FORMAT = 1000; /** * Sets the time format. */ public const FB_ATTR_TIME_FORMAT = 1001; /** * Sets the timestamp format. */ public const FB_ATTR_TIMESTAMP_FORMAT = 1002; /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)* This must be a valid SQL statement for the target database server. *
* @param array $options [optional]* This array holds one or more key=>value pairs to set * attribute values for the PDOStatement object that this method * returns. You would most commonly use this to set the * PDO::ATTR_CURSOR value to * PDO::CURSOR_SCROLL to request a scrollable cursor. * Some drivers have driver specific options that may be set at * prepare-time. *
* @return PDOStatement|false If the database server successfully prepares the statement, * PDO::prepare returns a * PDOStatement object. * If the database server cannot successfully prepare the statement, * PDO::prepare returns FALSE or emits * PDOException (depending on error handling). * *
* Emulated prepared statements does not communicate with the database server
* so PDO::prepare does not check the statement.
*/
#[TentativeType]
public function prepare(
#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query,
#[LanguageLevelTypeAware(['8.0' => 'array'], default: '')] $options = []
): PDOStatement|false {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
* Initiates a transaction
*
* Turns off autocommit mode. While autocommit mode is turned off, * changes made to the database via the PDO object instance are not committed * until you end the transaction by calling {@link PDO::commit()}. * Calling {@link PDO::rollBack()} will roll back all changes to the database and * return the connection to autocommit mode. *
** Some databases, including MySQL, automatically issue an implicit COMMIT * when a database definition language (DDL) statement * such as DROP TABLE or CREATE TABLE is issued within a transaction. * The implicit COMMIT will prevent you from rolling back any other changes * within the transaction boundary. *
* @link https://php.net/manual/en/pdo.begintransaction.php * @return bool TRUE on success or FALSE on failure. * @throws PDOException If there is already a transaction started or * the driver does not support transactions* The SQL statement to prepare and execute. *
** Data inside the query should be properly escaped. *
* @return int|false PDO::exec returns the number of rows that were modified * or deleted by the SQL statement you issued. If no rows were affected, * PDO::exec returns 0. * * This function may * return Boolean FALSE, but may also return a non-Boolean value which * evaluates to FALSE. Please read the section on Booleans for more * information. Use the === * operator for testing the return value of this * function. *
* The following example incorrectly relies on the return value of
* PDO::exec, wherein a statement that affected 0 rows
* results in a call to die:
*
* $db->exec() or die(print_r($db->errorInfo(), true));
*
*/
#[TentativeType]
public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int|false {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
* Executes an SQL statement, returning a result set as a PDOStatement object
* @link https://php.net/manual/en/pdo.query.php
* @param string $query
* The SQL statement to prepare and execute. *
** Data inside the query should be properly escaped. *
* @param int $fetchMode* The fetch mode must be one of the PDO::FETCH_* constants. *
* @param mixed $arg3* The second and following parameters are the same as the parameters for PDOStatement::setFetchMode. *
* @param array $ctorargs [optional]* Arguments of custom class constructor when the mode * parameter is set to PDO::FETCH_CLASS. *
* @return PDOStatement|false PDO::query returns a PDOStatement object, or FALSE * on failure. * @see PDOStatement::setFetchMode For a full description of the second and following parameters. */ #[PhpStormStubsElementAvailable(to: '7.4')] public function query($query, $fetchMode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, $ctorargs = []) {} /** * (PHP 5 >= 5.1.0, PHP 7, PHP 8, PECL pdo >= 0.2.0)* The SQL statement to prepare and execute. *
** Data inside the query should be properly escaped. *
* @param int|null $fetchMode* The fetch mode must be one of the PDO::FETCH_* constants. *
* @param mixed ...$fetch_mode_args* Arguments of custom class constructor when the mode * parameter is set to PDO::FETCH_CLASS. *
* @return PDOStatement|false PDO::query returns a PDOStatement object, or FALSE * on failure. * @see PDOStatement::setFetchMode For a full description of the second and following parameters. */ #[PhpStormStubsElementAvailable('8.0')] public function query( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $fetchMode = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$fetch_mode_args ) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)* Name of the sequence object from which the ID should be returned. *
* @return string|false If a sequence name was not specified for the name * parameter, PDO::lastInsertId returns a * string representing the row ID of the last row that was inserted into * the database. * ** If a sequence name was specified for the name * parameter, PDO::lastInsertId returns a * string representing the last value retrieved from the specified sequence * object. *
*
* If the PDO driver does not support this capability,
* PDO::lastInsertId triggers an
* IM001 SQLSTATE.
*/
#[TentativeType]
public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string|false {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
* Fetch the SQLSTATE associated with the last operation on the database handle
* @link https://php.net/manual/en/pdo.errorcode.php
* @return mixed an SQLSTATE, a five characters alphanumeric identifier defined in
* the ANSI SQL-92 standard. Briefly, an SQLSTATE consists of a
* two characters class value followed by a three characters subclass value. A
* class value of 01 indicates a warning and is accompanied by a return code
* of SQL_SUCCESS_WITH_INFO. Class values other than '01', except for the
* class 'IM', indicate an error. The class 'IM' is specific to warnings
* and errors that derive from the implementation of PDO (or perhaps ODBC,
* if you're using the ODBC driver) itself. The subclass value '000' in any
* class indicates that there is no subclass for that SQLSTATE.
*
* PDO::errorCode only retrieves error codes for operations * performed directly on the database handle. If you create a PDOStatement * object through PDO::prepare or * PDO::query and invoke an error on the statement * handle, PDO::errorCode will not reflect that error. * You must call PDOStatement::errorCode to return the error * code for an operation performed on a particular statement handle. *
*
* Returns NULL if no operation has been run on the database handle.
*/
#[TentativeType]
public function errorCode(): ?string {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
* Fetch extended error information associated with the last operation on the database handle
* @link https://php.net/manual/en/pdo.errorinfo.php
* @return array PDO::errorInfo returns an array of error information
* about the last operation performed by this database handle. The array
* consists of the following fields:
*
* If the SQLSTATE error code is not set or there is no driver-specific * error, the elements following element 0 will be set to NULL. *
*
* PDO::errorInfo only retrieves error information for
* operations performed directly on the database handle. If you create a
* PDOStatement object through PDO::prepare or
* PDO::query and invoke an error on the statement
* handle, PDO::errorInfo will not reflect the error
* from the statement handle. You must call
* PDOStatement::errorInfo to return the error
* information for an operation performed on a particular statement handle.
*/
#[ArrayShape([0 => "string", 1 => "int", 2 => "string"])]
#[TentativeType]
public function errorInfo(): array {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
* Retrieve a database connection attribute
* @link https://php.net/manual/en/pdo.getattribute.php
* @param int $attribute
* One of the PDO::ATTR_* constants. The constants that * apply to database connections are as follows: * PDO::ATTR_AUTOCOMMIT * PDO::ATTR_CASE * PDO::ATTR_CLIENT_VERSION * PDO::ATTR_CONNECTION_STATUS * PDO::ATTR_DRIVER_NAME * PDO::ATTR_ERRMODE * PDO::ATTR_ORACLE_NULLS * PDO::ATTR_PERSISTENT * PDO::ATTR_PREFETCH * PDO::ATTR_SERVER_INFO * PDO::ATTR_SERVER_VERSION * PDO::ATTR_TIMEOUT *
* @return mixed A successful call returns the value of the requested PDO attribute. * An unsuccessful call returns null. */ #[TentativeType] public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute): mixed {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.1)* The string to be quoted. *
* @param int $type [optional]* Provides a data type hint for drivers that have alternate quoting styles. *
* @return string|false a quoted string that is theoretically safe to pass into an * SQL statement. Returns FALSE if the driver does not support quoting in * this way. */ #[TentativeType] public function quote( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR ): string|false {} final public function __wakeup() {} final public function __sleep() {} /** * (PHP 5 >= 5.1.3, PHP 7, PECL pdo >= 1.0.3)* The name of the function used in SQL statements. *
* @param callable $step_func* Callback function called for each row of the result set. Your PHP function should accumulate the result and store it in the aggregation context. *
* @param callable $finalize_func* Callback function to aggregate the "stepped" data from each row. Once all the rows have been processed, this function will be called and it should then take the data from the aggregation context and return the result. This callback function should return a type understood by SQLite (i.e. scalar type). *
* @param int $num_args [optional]* Hint to the SQLite parser if the callback function accepts a predetermined number of arguments. *
* @return bool TRUE on success or FALSE on failure. */ public function sqliteCreateAggregate($function_name, $step_func, $finalize_func, $num_args = -1) {} /** * (PHP 5 >= 5.3.11, PHP 7)* Name of the SQL collating function to be created or redefined. *
* @param callable $callback* The name of a PHP function or user-defined function to apply as a callback, defining the behavior of the collation. It should accept two strings and return as strcmp() does, i.e. it should return -1, 1, or 0 if the first string sorts before, sorts after, or is equal to the second. *
* @return bool TRUE on success or FALSE on failure. */ public function sqliteCreateCollation($name, $callback) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo_sqlite >= 1.0.0)* The name of the function used in SQL statements. *
* @param callable $callback* Callback function to handle the defined SQL function. *
* @param int $num_args [optional]* The number of arguments that the SQL function takes. If this parameter is -1, * then the SQL function may take any number of arguments. *
* @param int $flags [optional]* A bitwise conjunction of flags. Currently, only PDO::SQLITE_DETERMINISTIC is supported, * which specifies that the function always returns the same result given the same inputs within * a single SQL statement. *
* @return bool TRUE on success or FALSE on failure. */ public function sqliteCreateFunction($function_name, $callback, $num_args = -1, $flags = 0) {} /** * (PHP 5 >= 5.3.3, PHP 7, PHP 8)* String containing table name *
* @param array $rows* Array of strings with fields separated by separator *
* @param string $separator* Separator used in rows array *
* @param string $nullAs* How to interpret null values *
* @param ?string $fields* List of fields to insert *
* @return bool TRUE on success or FALSE on failure. */ public function pgsqlCopyFromArray(string $tableName, array $rows, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {} /** * (PHP 5 >= 5.3.3, PHP 7, PHP 8)* String containing table name *
* @param string $filename* Filename containing data to import *
* @param string $separator* Separator used in file specified by filename *
* @param string $nullAs* How to interpret null values *
* @param ?string $fields* List of fields to insert *
* @return bool TRUE on success or FALSE on failure. */ public function pgsqlCopyFromFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {} /** * (PHP 5 >= 5.3.3, PHP 7, PHP 8)* String containing table name *
* @param string $separator* Separator used in rows *
* @param string $nullAs* How to interpret null values *
* @param ?string $fields* List of fields to insert *
* @return array|false returns an array of rows, or FALSE on failure. */ public function pgsqlCopyToArray(string $tableName, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): array|false {} /** * (PHP 5 >= 5.3.3, PHP 7, PHP 8)* String containing table name *
* @param string $filename* Filename to export data *
* @param string $separator* Separator used in file specified by filename *
* @param string $nullAs* How to interpret null values *
* @param ?string $fields* List of fields to insert *
* @return bool TRUE on success or FALSE on failure. */ public function pgsqlCopyToFile(string $tableName, string $filename, string $separator = "\t", string $nullAs = "\\\\N", ?string $fields = null): bool {} /** * (PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL pdo_pgsql >= 1.0.2)* A large object identifier. *
* @param string $mode* If mode is r, open the stream for reading. If mode is w, open the stream for writing. *
* @return resource|false returns a stream resource on success or FALSE on failure. */ public function pgsqlLOBOpen(string $oid, string $mode = "rb") {} /** * (PHP 5 >= 5.1.2, PHP 7, PHP 8, PECL pdo_pgsql >= 1.0.2)* A large object identifier. *
* @return bool TRUE on success or FALSE on failure. */ public function pgsqlLOBUnlink(string $oid): bool {} /** * (PHP 5 >= 5.6.0, PHP 7, PHP 8)* The format the result set should be returned as, represented as a PDO::FETCH_* constant. *
* @param int $timeoutMilliseconds* The length of time to wait for a response, in milliseconds. *
* @return array|false if one or more notifications is pending, returns a single row, * with fields message and pid, otherwise FALSE. */ public function pgsqlGetNotify(int $fetchMode = PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0): array|false {} /** * (PHP 5 >= 5.6.0, PHP 7, PHP 8)* An array of values with as many elements as there are bound * parameters in the SQL statement being executed. * All values are treated as PDO::PARAM_STR. *
** You cannot bind multiple values to a single parameter; for example, * you cannot bind two values to a single named parameter in an IN() * clause. *
** You cannot bind more values than specified; if more keys exist in * input_parameters than in the SQL specified * in the PDO::prepare, then the statement will * fail and an error is emitted. *
* @return bool TRUE on success or FALSE on failure. * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true. */ #[TentativeType] public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $params = null): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)* Controls how the next row will be returned to the caller. This value * must be one of the PDO::FETCH_* constants, * defaulting to value of PDO::ATTR_DEFAULT_FETCH_MODE * (which defaults to PDO::FETCH_BOTH). *
** PDO::FETCH_ASSOC: returns an array indexed by column * name as returned in your result set *
* @param int $cursorOrientation [optional]* For a PDOStatement object representing a scrollable cursor, this * value determines which row will be returned to the caller. This value * must be one of the PDO::FETCH_ORI_* constants, * defaulting to PDO::FETCH_ORI_NEXT. To request a * scrollable cursor for your PDOStatement object, you must set the * PDO::ATTR_CURSOR attribute to * PDO::CURSOR_SCROLL when you prepare the SQL * statement with PDO::prepare. *
* @param int $cursorOffset [optional] * @return mixed The return value of this function on success depends on the fetch type. In * all cases, FALSE is returned on failure. */ #[TentativeType] public function fetch( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOrientation = PDO::FETCH_ORI_NEXT, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOffset = 0 ): mixed {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)* Parameter identifier. For a prepared statement using named * placeholders, this will be a parameter name of the form * :name. For a prepared statement using * question mark placeholders, this will be the 1-indexed position of * the parameter. *
* @param mixed &$var* Name of the PHP variable to bind to the SQL statement parameter. *
* @param int $type [optional]* Explicit data type for the parameter using the PDO::PARAM_* * constants. * To return an INOUT parameter from a stored procedure, * use the bitwise OR operator to set the PDO::PARAM_INPUT_OUTPUT bits * for the data_type parameter. *
* @param int $maxLength [optional]* Length of the data type. To indicate that a parameter is an OUT * parameter from a stored procedure, you must explicitly set the * length. *
* @param mixed $driverOptions [optional]*
* @return bool TRUE on success or FALSE on failure. */ #[TentativeType] public function bindParam( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)* Number of the column (1-indexed) or name of the column in the result set. * If using the column name, be aware that the name should match the * case of the column, as returned by the driver. *
* @param mixed &$var* Name of the PHP variable to which the column will be bound. *
* @param int $type [optional]* Data type of the parameter, specified by the PDO::PARAM_* constants. *
* @param int $maxLength [optional]* A hint for pre-allocation. *
* @param mixed $driverOptions [optional]* Optional parameter(s) for the driver. *
* @return bool TRUE on success or FALSE on failure. */ #[TentativeType] public function bindColumn( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 1.0.0)* Parameter identifier. For a prepared statement using named * placeholders, this will be a parameter name of the form * :name. For a prepared statement using * question mark placeholders, this will be the 1-indexed position of * the parameter. *
* @param mixed $value* The value to bind to the parameter. *
* @param int $type [optional]* Explicit data type for the parameter using the PDO::PARAM_* * constants. *
* @return bool TRUE on success or FALSE on failure. */ #[TentativeType] public function bindValue( #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_STR ): bool {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)* 0-indexed number of the column you wish to retrieve from the row. If * no value is supplied, PDOStatement::fetchColumn * fetches the first column. *
* @return mixed Returns a single column from the next row of a result * set or FALSE if there are no more rows. * *
* There is no way to return another column from the same row if you
* use PDOStatement::fetchColumn to retrieve data.
*/
#[TentativeType]
public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column = 0): mixed {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
* Returns an array containing all of the result set rows
* @link https://php.net/manual/en/pdostatement.fetchall.php
* @param int $mode [optional]
* Controls the contents of the returned array as documented in * PDOStatement::fetch. * Defaults to value of PDO::ATTR_DEFAULT_FETCH_MODE * (which defaults to PDO::FETCH_BOTH) *
** To return an array consisting of all values of a single column from * the result set, specify PDO::FETCH_COLUMN. You * can specify which column you want with the * column-index parameter. *
** To fetch only the unique values of a single column from the result set, * bitwise-OR PDO::FETCH_COLUMN with * PDO::FETCH_UNIQUE. *
** To return an associative array grouped by the values of a specified * column, bitwise-OR PDO::FETCH_COLUMN with * PDO::FETCH_GROUP. *
* @param mixed ...$args* Arguments of custom class constructor when the fetch_style * parameter is PDO::FETCH_CLASS. *
* @return array|false PDOStatement::fetchAll returns an array containing * all of the remaining rows in the result set. The array represents each * row as either an array of column values or an object with properties * corresponding to each column name. * An empty array is returned if there are zero results to fetch, or false on failure. * *
* Using this method to fetch large result sets will result in a heavy
* demand on system and possibly network resources. Rather than retrieving
* all of the data and manipulating it in PHP, consider using the database
* server to manipulate the result sets. For example, use the WHERE and
* ORDER BY clauses in SQL to restrict results before retrieving and
* processing them with PHP.
*/
#[TentativeType]
public function fetchAll(
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH,
#[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $fetch_argument = null,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args
): array {}
/**
* @template T
*
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.4)
* Name of the created class.
*
* Elements of this array are passed to the constructor.
*
* The 0-indexed column in the result set.
*
* Fetches the next row and returns it as an object.
* @link https://php.net/manual/en/pdostatement.fetchobject.php
* @param class-string
* Fetch the SQLSTATE associated with the last operation on the statement handle
* @link https://php.net/manual/en/pdostatement.errorcode.php
* @return string Identical to PDO::errorCode, except that
* PDOStatement::errorCode only retrieves error codes
* for operations performed with PDOStatement objects.
*/
#[TentativeType]
public function errorCode(): ?string {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)
* Fetch extended error information associated with the last operation on the statement handle
* @link https://php.net/manual/en/pdostatement.errorinfo.php
* @return array PDOStatement::errorInfo returns an array of
* error information about the last operation performed by this
* statement handle. The array consists of the following fields:
*
*
* Element
* Information
*
*
* 0
* SQLSTATE error code (a five characters alphanumeric identifier defined
* in the ANSI SQL standard).
*
*
* 1
* Driver specific error code.
*
*
*/
#[ArrayShape([0 => "string", 1 => "int", 2 => "string"])]
#[TentativeType]
public function errorInfo(): array {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)2
* Driver specific error message.
*
* Set a statement attribute
* @link https://php.net/manual/en/pdostatement.setattribute.php
* @param int $attribute
* @param mixed $value
* @return bool TRUE on success or FALSE on failure.
*/
#[TentativeType]
public function setAttribute(
#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute,
#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value
): bool {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
* Retrieve a statement attribute
* @link https://php.net/manual/en/pdostatement.getattribute.php
* @param int $name
* @return mixed the attribute value.
*/
#[TentativeType]
public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $name): mixed {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
* Returns the number of columns in the result set
* @link https://php.net/manual/en/pdostatement.columncount.php
* @return int the number of columns in the result set represented by the
* PDOStatement object. If there is no result set,
* PDOStatement::columnCount returns 0.
*/
#[TentativeType]
public function columnCount(): int {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
* Returns metadata for a column in a result set
* @link https://php.net/manual/en/pdostatement.getcolumnmeta.php
* @param int $column
Name | *Value | *
native_type | *The PHP native type used to represent the column value. | *
driver:decl_type | *The SQL type used to represent the column value in the database. * If the column in the result set is the result of a function, this value * is not returned by PDOStatement::getColumnMeta. * | *
flags | *Any flags set for this column. | *
name | *The name of this column as returned by the database. | *
table | *The name of this column's table as returned by the database. | *
len | *The length of this column. Normally -1 for * types other than floating point decimals. | *
precision | *The numeric precision of this column. Normally * 0 for types other than floating point * decimals. | *
pdo_type | *The type of this column as represented by the * PDO::PARAM_* constants. | *
* Returns FALSE if the requested column does not exist in the result set,
* or if no result set exists.
*/
#[TentativeType]
#[ArrayShape([
"name" => "string",
"len" => "int",
"precision" => "int",
"oci:decl_type" => "int|string",
"native_type" => "string",
"scale" => "int",
"flags" => "array",
"pdo_type" => "int"
])]
public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): array|false {}
/**
* (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)
* Set the default fetch mode for this statement
* @link https://php.net/manual/en/pdostatement.setfetchmode.php
* @param int $mode
* The fetch mode must be one of the PDO::FETCH_* constants. *
* @param null|string|object $className [optional]* Class name or object *
* @param array $params [optional]Constructor arguments.
* @return bool TRUE on success or FALSE on failure. */ #[PhpStormStubsElementAvailable(to: '7.4')] public function setFetchMode($mode, $className = null, $params = []) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)* The fetch mode must be one of the PDO::FETCH_* constants. *
* @param string|object|null $className [optional]* Class name or object *
* @param mixed ...$paramsConstructor arguments.
* @return bool TRUE on success or FALSE on failure. */ #[PhpStormStubsElementAvailable('8.0')] public function setFetchMode($mode, $className = null, ...$params) {} /** * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)