<?php
session_start();

include("connect.php");
//include("user.php");

$username = $_SESSION['username'];
$rolemaster_id = $_SESSION['rolemaster_id'];
//echo "hiiiiiii";

 $followingsts=$_REQUEST['followingsts'];
 $user_id=$_REQUEST['user_id'];
 



	
   if ($followingsts==1) 
   {
	  
                $insertQuery = $con->query("INSERT INTO `following_details`(`id`, `user_id`, `role_master_id`, `following_sts`, `created_on`) VALUES (NULL,'$user_id','$rolemaster_id','1','now()')");
			     
				 
				 
			 if($insertQuery)
			  {
				   $updateQuery = $con->query("UPDATE `user_master` SET `followsts` = '1' WHERE `id` = '$user_id'");
				  echo 1;
				 
			  }
			  else
			 {
				  echo 0;
				
			  }
			   
   }
  /* else if ($save_no!=1) 
   {
	   
	   $updateuery=$con->query("DELETE FROM `poster_download` WHERE poster_id='$post_id' and downloader_id='$rolemaster_id' and donwload_sts='1'");
	   
	   if($updateuery)
			  {
				  echo 0;
				 
			  }
			  else
			 {
				  echo 1;
				
			  }
   }*/

?>
