New to php but learning a lot. Relatively simple question that I believe uses the JOIN command. In my code...
This gets and prints out the current session user:
$userId = $_SESSION['user_id'];
echo $userId;
But user_id is just a number in my members table, so that will print out "3" or some such. In the same members table, there is a column called 'username' where 3 (id column) is associated with 'Brad' (username column.)
What would the echo command be to get it to print Brad? I tried something like
$actualname = mysqli_query($con,"SELECT members.username JOIN members on userid=members.id");
echo $actualname;
I don't have a great sense for how the join command functions yet, any help would be great!