<?php
session_start();
// Function to add activity log
function user_activity($conn,$user_id,$note) {
 // echo $user_id;
include '../../assets/constant/config.php';


try {
  $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
  $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// connect author at mdkhairnar92@gmail.com 

        // Prepare SQL statement
         $timestamp = date("Y-m-d H:i:s");
    $sql ="INSERT INTO `activity` (user_id, note, add_date) VALUES (?, ?, ?)";
    $stmt=$conn->prepare($sql);
    $stmt->execute([$user_id, $note, $timestamp]);

       // echo "Activity logged successfully.";
    } catch (PDOException $e) {
        echo "Error: " . $e->getMessage();
    }
}
?>








<!--  connect author at mdkhairnar92@gmail.com  -->


  
