<?php
include "ChatConfig.php";
include_once "jdf.php";
$sql =
    "INSERT INTO group_" .
    $_POST["GRP"] .
    ' (id, username, message, path, type, replay, time)
  VALUES (NULL, "' .
    $_POST["USR"] .
    '", "' .
    $_POST["MSG"] .
    '", "' .
    $_POST["FIL"] .
    '", "' .
    $_POST["TYP"] .
    '", "' .
    $_POST["RPL"] .
    '", "' .
    jdate("H:i:s, j F Y") .
    '")';
$query = $connection->prepare($sql);
$query->execute();
$json = array('date'=>jdate("H:i:s, j F Y"), 'id'=>$connection->lastInsertId());
print_r( json_encode($json));
?>