Class Connection
Represents a connection between PHP and a database server.
-
Nette\Object
-
Nette\Database\Connection
Methods summary
public
|
#
__construct( $dsn, $user = NULL, $password = NULL, array $options = NULL )
|
public
|
|
public
|
|
public
|
|
public
string
|
|
public
PDO
|
|
public
Nette\Database\ISupplementalDriver
|
|
public
string
|
#
getInsertId( string $name = NULL )
Parameters
Returns
string string
|
public
string
|
#
quote( string $string, integer $type = Nette\Database\PDO::PARAM_STR )
Parameters
- $string
- to be quoted
- $type
- type hint
Returns
string string
|
public
|
|
public
|
|
public
|
|
public
Nette\Database\ResultSet
|
#
query( string $sql )
Generates and executes SQL query.
Generates and executes SQL query.
Parameters
Returns
|
public
Nette\Database\ResultSet
|
|
public
[string,
|
|
public
Nette\Database\Row
|
#
fetch( string $args )
Shortcut for query()->fetch()
Shortcut for query()->fetch()
Parameters
Returns
|
public
mixed
|
#
fetchField( string $args )
Shortcut for query()->fetchField()
Shortcut for query()->fetchField()
Parameters
Returns
mixed mixed
|
public
array
|
#
fetchPairs( string $args )
Shortcut for query()->fetchPairs()
Shortcut for query()->fetchPairs()
Parameters
Returns
array array
|
public
array
|
#
fetchAll( string $args )
Shortcut for query()->fetchAll()
Shortcut for query()->fetchAll()
Parameters
Returns
array array
|
public static
Nette\Database\SqlLiteral
|
|
Properties summary
public
callable[]
|
$onConnect
function (Connection $connection); Occurs after connection is established
function (Connection $connection); Occurs after connection is established
|
|
public
callable[]
|
$onQuery
function (Connection $connection, ResultSet|DriverException $result); Occurs
after query is executed
function (Connection $connection, ResultSet|DriverException $result); Occurs
after query is executed
|
|