Avolutions\Database\Database
extends PDOThe Database class provides some functions to connect to a MySQL database, execute queries and perform schema changes (migrations) on the database.
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates a database connection using the config values from database configuration file. |
Method Details
__construct()
Creates a database connection using the config values from database configuration file.
public
__construct(string $host, string $database, string $port, string $user, string $password[, string $charset = 'utf8' ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
string
$host
Hostname of the database.
string
$database
Database name.
string
$port
Database port.
string
$user
User to connect to database with.
string
$password
Password for database user.
string
$charset
(optional)
The character set.
array<string|int, mixed>
$options
(optional)
Array of driver specific connection options.