title: Getting User's name from table when they login with e-mail
body: <p>The user table is setup as:
  ID | Name | Email | Password</p>
  
  <p>and they login with: </p>
  
  <p>Email | Password</p>
  
  <p>I'm wondering how I can display their 'Name' when they login with their e-mail. What I have so  far that works with email is: </p>
  
  <pre><code>session_start();
  
  if (!isset($_SESSION['email'])) {
      header('location: ');
  }
  
  include_once('config.php');
  
  $email = $_SESSION['email'];
  
  &lt;!doctype html&gt;
  &lt;body&gt; 
      &lt;p&gt;&lt;?php echo $email; ?&gt;
  </code></pre>
  
  <p>and that works, but when I try something like </p>
  
  <pre><code>$sql = "SELECT name FROM $table WHERE email='$_SESSION["email"]'";
  $result = mysql_query($sql);
  
  &lt;!doctype html&gt; 
  &lt;body&gt;
      &lt;p&gt;&lt;?php echo $result; ?&gt;&lt;/p&gt;
  </code></pre>
  
  <p>that doesn't work.
  Any help is appreciated</p>