class MySQL (View source)

Constants

ATTR_OPT_CONNECT_TIMEOUT

Connection attribute to set the connection timeout.

ATTR_OPT_READ_TIMEOUT

Connection attribute to set the read timeout.

ATTR_PERSISTENT

Connection attribute to set persistence of the connection.

ATTR_AUTOCOMMIT

Connection attribute to set the auto-commit mode.

ATTR_INIT_COMMAND

Connection attribute to set the initial command.

ATTR_SET_CHARSET_NAME

Connection attribute to set the character set.

ATTR_READ_DEFAULT_GROUP

Connection attribute to set the read default group.

ATTR_OPT_INT_AND_FLOAT_NATIVE

Connection attribute to set integer and float values as native types.

ATTR_OPT_SSL_VERIFY_SERVER_CERT

Connection attribute to verify the server certificate in SSL.

ATTR_OPT_LOCAL_INFILE

Connection attribute to verify the server certificate in SSL.

ATTR_DEFAULT_FETCH_MODE

Connection attribute to set the default fetch mode.

ATTR_REPORT

Connection attribute to set the default report mode.

REPORT_OFF

Turns reporting off alias for MYSQLI_REPORT_OFF

REPORT_ERROR

Report errors from mysqli function calls alias for MYSQLI_REPORT_ERROR

REPORT_STRICT

Throw exception for errors instead of warnings alias for MYSQLI_REPORT_STRICT

REPORT_INDEX

Report if no index or bad index was used in a query alias for MYSQLI_REPORT_INDEX

REPORT_ALL

Report all errors alias for MYSQLI_REPORT_ALL

FETCH_LAZY

Fetch mode that starts fetching rows only when they are requested.

FETCH_ASSOC

Constant for the fetch mode representing fetching as an associative array

FETCH_NUM

Constant for the fetch mode representing fetching as a numeric array

FETCH_BOTH

Constant for the fetch mode representing fetching as both a numeric and associative array

FETCH_OBJ

Constant for the fetch mode representing fetching as an object

FETCH_BOUND

Fetch mode that requires explicit binding of PHP variables to fetch values.

FETCH_COLUMN

Constant for the fetch mode representing fetching a single column

FETCH_CLASS

Constant for the fetch mode representing fetching into a new instance of a specified class

FETCH_INTO

Constant for the fetch mode representing fetching into an existing object

Properties

static protected array $dataAttribute

Array of data attributes.

Methods

static mixed
getAttribute(mixed $name)

Retrieves the value of a specific attribute by name or constant.

static void
setAttribute(mixed $name, mixed $value)

Sets the value of a specific attribute by name or constant.

Details

static mixed getAttribute(mixed $name)

Retrieves the value of a specific attribute by name or constant.

Parameters

mixed $name

The name of the attribute or the constant associated with it.

Return Value

mixed

The value of the attribute if found; null otherwise.

Exceptions

ReflectionException

static void setAttribute(mixed $name, mixed $value)

Sets the value of a specific attribute by name or constant.

Parameters

mixed $name

The name of the attribute or the constant associated with it. If null, the value is appended.

mixed $value

The value to set for the specified attribute.

Return Value

void

Exceptions

ReflectionException