<?php
include "../db_connect.php";

$follower_id = $_POST['follower_id'];     // লগইন করা ইউজার
$following_id = $_POST['following_id'];   // পোস্টদাতা

$con = dbConnect();

$sql = "SELECT id FROM followers WHERE follower_id = ? AND following_id = ?";
$stmt = $con->prepare($sql);
$stmt->bind_param("ii", $follower_id, $following_id);
$stmt->execute();
$result = $stmt->get_result();

if ($result->num_rows > 0) {
    echo json_encode(["followed" => true]);
} else {
    echo json_encode(["followed" => false]);
}
?>
