I am trying to created a way to call information from the database for a user to view. Such as they log in and it has their registered information viewed. I have this

```
session_start();
if($_SESSION['id'])
$result = mysql_query("SELECT * FROM User WHERE `id` = $_SESSION[id]")
or die(mysql_error());  

 while($row = mysql_fetch_array( $result )) {
 echo '<b>First Name:</b>' .$row['fname'];
 echo '<br>';
 echo '<b>Last Name:</b>' .$row['lname'];
 }

```

but nothing shows up. My database name is megan, table is user, fields i want displayed are first name (fname) and last name (lname).
Can someone point me in the right direction. Thank you in advance!