title: Display current logged in user's profile
body: <p>I've been working on code for student registration. I finished coding for my log in.</p>
  
  <p>What I'm having a problem with is showing the user's profile: student <code>fname</code>, <code>lname</code>, <code>program</code>, <code>gender</code> and <code>year</code> level in textboxes. I'm using MySQL as my back end. </p>
  
  <p>My code is like this:</p>
  
  <pre><code>&lt;?php 
  
  // connects to the database
  $mysqli = new mysqli("localhost", "root", "");
  
  $query = 'SELECT fname, lname, program, gender, year FROM students WHERE fname =     '.$_SESSION['myusername'];
  $mysqli-&gt;query($query);
  
  
  echo "&lt;div align=\"center\"&gt;";
  echo "&lt;br /&gt;Your &lt;b&gt;&lt;i&gt;Profile&lt;/i&gt;&lt;/b&gt; is as follows:&lt;br /&gt;";
  echo "&lt;b&gt;First name:&lt;/b&gt; ". $_POST['fname'];
  echo "&lt;br /&gt;&lt;b&gt;Last name:&lt;/b&gt; ".$_POST['lname'];
  echo "&lt;br /&gt;&lt;b&gt;Program:&lt;/b&gt; ".$_POST['program'];
  echo "&lt;br /&gt;&lt;b&gt;Year:&lt;/b&gt; ".$_POST['year'];
  echo "&lt;br /&gt;&lt;b&gt;Gender:&lt;/b&gt; ".$_POST['gender'];
  echo "&lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p>This is my code for <a href="http://pastebin.com/jEuXtArd" rel="nofollow">mainstudent.php</a> and <a href="http://pastebin.com/GH2UbGpJ" rel="nofollow">checklogin.php</a>.</p>