<?php    
    include '../db_conn.php';

    $query = "INSERT INTO chat (message) VALUES(:message)";

    $statement = $db->prepare($query);

    try {
        $statement->execute(array(
            "message" => htmlspecialchars($_POST['message'])));
    } catch (PDOException $ex2) {
        echo $query . "<br>" . $ex2;
        die("Error connecting to SQL server.");
    }
?>
