<?php
require 'includes/db.php';
session_start();

if (!isset($_SESSION['user_id'])) {
    exit;
}

$user_id = $_SESSION['user_id'];

$res = mysqli_query($conn, "
    SELECT payment_status FROM users 
    WHERE id='$user_id' LIMIT 1
");

$row = mysqli_fetch_assoc($res);

echo $row['payment_status'] ?? 0;