<?php
    ob_start(); //Turns on output buffering 
    session_start();
    
    date_default_timezone_set("Asia/Bangkok");
    // attempt to connect to the database via PDO
    $servername = "localhost";
    $username = "posts";
    $password = "XL8YkuMhUncCG3SYs2725KQBaETHvLtnJDg9AE3kVAQe27wxmegyDKHBf3sSmu54yLzNknC2ynsrjRDW2RWXrXqUFh8em9pzBXYVMPg48KFQ6kMuMvj5bNTUpSPkx3zN";

    try {
        $con = new PDO("mysql:host=$servername;dbname=blogs", $username, $password);
        // set the PDO error mode to exception
        $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    } catch(PDOException $e) {
        echo "Connection failed: " . $e->getMessage();
    }
    
    header('Content-Type: text/html; charset=utf-8');
?>