for the past few i have been trying to get the ID of the event a user registers to inside the URL in order to show all details in that event.
Ive tried Get data from MySQL database by specific id in url But it doesnt seem to work for what i am trying to do. Or i am doing it wrong, i got more progress with this code
<?php
if(isset($_SESSION['user_id'])){
$userid = $_SESSION['user_id'];
$QUERY3 = mysqli_query($DB, "SELECT * FROM `registration` WHERE `user_id`='$userid'");
$GETEVENTZ = mysqli_fetch_array($QUERY3);
}
?>
<?php
$eventid = $GETEVENTZ['event_id'];
echo '<li> <a href="leaderboard.php?eventid='.$eventid.'"><i class="icon icon-list"></i><span>Leaderboards</span></a> </li>'
?>
Just to try and get the ID in but im getting a normal page with the url being
leaderboard.php?eventid=
and no ID after, no errors are popping up, page and everything loads, just doesnt add ID. cant seem to find the issue