<?php
session_start();
include('db_connection.php'); // Ensure this path is correct

if (isset($_SESSION['student_id'])) {
    $studentId = $_SESSION['student_id'];
    $updateStatusQuery = "UPDATE profiles SET online_status = 'online' WHERE student_id = ?";
    $updateStatusStmt = $conn->prepare($updateStatusQuery);
    $updateStatusStmt->bind_param('i', $studentId);
    $updateStatusStmt->execute();
}
?>
