Trying to get the value I'm setting at the end for $_SESSION to be the user_id from the query, and not $username. I can't seem to work my way around modifying the query. I'm sure this is crazy easy for some of the gurus here.
if(isset($_POST['login']))
{
$username = mysqli_real_escape_string($conn,$_POST['username']);
$pass = mysqli_real_escape_string($conn,$_POST['password']);
$sel_user = "select user_id, user_first_name from users where username='$username' AND password='$pass'";
$run_user = mysqli_query($conn, $sel_user);
$check_user = mysqli_num_rows($run_user);
if($check_user>0){
$_SESSION['session_id']=$username;
}
}