i have tried sending the active session username to the database but it cant get to the database yet i believe i have done everything right. Here is my code:
<?php
session_start();
$conn= mysqli_connect("localhost","root","","alex db");
if(isset($_POST['state'])) {
$id=$_POST['id'];
$state=$_POST['input'];
$name=$_SESSION['username'];
$sql ="INSERT INTO post(state,vendor_name) values('$state','$name')";
$query=mysqli_query($conn, $sql);
}
?>