how do i use session php to display info

Discussion in 'PHP & Perl' started by De Code, May 28, 2018.

  1. De Code

    De Code Newbie

    Joined:
    May 14, 2018
    Messages:
    11
    Likes Received:
    0
    Gender:
    Male
    Hello,

    how do i use the session.php to display information for example profile page

    i did this , could anyone help
    PHP:
    $query "SELECT userintake from login where username = '$user_check'";
    $ses_sql mysqli_query($conn$query);
    $row mysqli_fetch_assoc($ses_sql);
    $userintake $row['userintake'];
    how do i show userintake variable on a page?
     
  2. tanglewood

    tanglewood Newbie

    Joined:
    May 18, 2018
    Messages:
    6
    Likes Received:
    1
    Provided all the code above is correct, then there are a number of ways, but here are two:

    <? echo $userintake; ?>
    <?= $userintake; ?>

    This is just my way... if there’s logic involved, then it’s with echo, and if it’s just displaying the data or setting a value attribute in a form field, I use <?=