メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

Pdo::__construct

Pdo class constructor

Description​

public Pdo::__construct( [ string $env = '' ] )

Loads database_config.php and database_regular_use_query.php (see Configuration). Nothing is connected until the first query; connections are shared by every instance.

Arguments​

NameData typeDefaultRemarks
$envstring''Config sub directory: 'name' reads name/database_config.php and name/database_regular_use_query.php

Example​

Controller
use Fegg\Database\Pdo;

$db = new Pdo();
$rows = $db->setQuery('SELECT * FROM cms_news WHERE valid = 1 AND category = ?', array(2))->execute()->all();