Connection
class Connection
Represents a connection between PHP and a database server.
Properties
$onConnect | |||
$onQuery |
Methods
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Shortcut for query()->fetch()
Shortcut for query()->fetchField()
Shortcut for query()->fetchFields()
Shortcut for query()->fetchPairs()
Shortcut for query()->fetchAll()
No description
Details
at line 40
__construct(string $dsn, string|null $user = null, string|null $password = null, array|null $options = null)
No description
at line 51
void
connect()
No description
at line 72
void
reconnect()
No description
at line 79
void
disconnect()
No description
at line 85
string
getDsn()
No description
at line 92
PDO
getPdo()
deprecated use getDriver()->getPdo()
at line 99
Driver
getDriver()
No description
at line 107
Driver
getSupplementalDriver()
deprecated
deprecated
No description
at line 115
Connection
setRowNormalizer(callable|null $normalizer)
No description
at line 122
string
getInsertId(string|null $sequence = null)
No description
at line 129
string
quote(string $string)
No description
at line 136
void
beginTransaction()
No description
at line 146
void
commit()
No description
at line 156
void
rollBack()
No description
at line 166
mixed
transaction(callable $callback)
No description
at line 197
ResultSet
query(string $sql, ...$params)
Generates and executes SQL query.
at line 213
ResultSet
queryArgs(string $sql, array $params)
deprecated
deprecated
No description
at line 224
array
preprocess(string $sql, ...$params)
No description
at line 233
string|null
getLastQueryString()
No description
at line 246
Row|null
fetch(string $sql, ...$params)
Shortcut for query()->fetch()
at line 256
mixed
fetchField(string $sql, ...$params)
Shortcut for query()->fetchField()
at line 266
array|null
fetchFields(string $sql, ...$params)
Shortcut for query()->fetchFields()
at line 276
array
fetchPairs(string $sql, ...$params)
Shortcut for query()->fetchPairs()
at line 286
array
fetchAll(string $sql, ...$params)
Shortcut for query()->fetchAll()
at line 292
static SqlLiteral
literal(string $value, ...$params)
No description
Traits
Strict class for better experience.