<?php ini_set('display_errors', 1); error_reporting(E_ALL); function get_pdo() { $dsn = sprintf('mysql:dbname=%s;host=%s;charset=%s' , 'database' , 'localhost' , 'utf8' ); $username = 'root'; $password = 'password'; $options = [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]; return new PDO($dsn, $username, $password, $options); } function fetch_array() { $pdo = get_pdo(); $statement = 'select * from