<?php

namespace App\Models;

use \PDO;

class DB
{
    public function connect()
    {
        $host = DB_HOST;
        $user = DB_USERNAME;
        $pass = DB_PASSWORD;
        $dbname = DB_NAME;

        $conn_str = "mysql:host=$host;dbname=$dbname";
        $conn = new PDO($conn_str, $user, $pass);
        $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        return $conn;
    }
}
