<?php

include("../dbConnect.php");

/*
$days = date("t");
$dt = new DateTime();
$year= $dt->format('Y');
$month= $dt->format('m');

$result=mysqli_query($hookup, "SELECT COUNT(*) YEAR(date) AS 'year', MONTH(date) AS 'month'
 FROM Table Where 'year' = '$year' AND 'month' = '$month'");
$num = mysqli_fetch_array($result);
$users = $num["id"];
*/
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


$id = $_POST['id'];
$check = $_POST['subscribed'];

$sql = "UPDATE `Users` SET `subscribed` = '$check' WHERE `ID` = '$id'";

if(mysqli_query($hookup, $sql)){

	$return = "success";
        echo $return;
}else{
        $return = "error=" . $type. " / ". mysqli_error($hookup);
        echo $return;
 }
?>
