So i'm trying to use this script to check whether a members "Subscription" is active on my website.
1 Being Yes 0 Being No
Right now i'm just trying to display the result of the query and it does not show up on screen.
If anyone could help it would be greatly appreciated.
<?php
require_once 'config.php';
// If session variable is not set it will redirect to login page
if(!isset($_SESSION['username']) || empty($_SESSION['username'])){
header("location: login.php");
exit;
}
$query = "SELECT Subscription FROM users WHERE username="$_SESSION['username']"";
$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
$result = mysqli_query($link, $query);
?>
<!DOCTYPE html>
<html>
<head>Test</head>
<body>
<h1> Subscription= <?php echo htmlspecialchars($result); ?></h1>
</body>
</html>