<?php 
include("../includes/connect.php");

print_r($_POST);
// TODO - Sanitize input
$externalId = $_POST['externalId'];

$id = explode("-",$externalId);
$cid = $id[1];
$eid = $id[0];

$qid = $_POST['questionId'];
$aid = $_POST['answerId'];

$answersTable = "campaign" . $cid . "_user_answers_preform";
$connection->query("INSERT INTO $answersTable (campaign_id,externalId,questionId,answerId) VALUES ('$cid','$eid','$qid','$aid')");
?>
{"success":true,"followUps":[]}