how to print out a username and user age based on session login
<p>i am fairly new to php. I am trying to print out the username and age based on the user session login, and cant seem to figure it out. 
I have two separate table, one for login and another that contains the users info.</p>

<blockquote>
  <p>user table   id-> 1 | logon -> shawn@aol.com | passwrd -> somthing<br>
     usersinfo    id-> 1 |  logon ->shawn@aol.com | username -> mathewkng1 | age -> 23</p>
</blockquote>

<p>i can print out the session login using <code>$_SESSION['logon']</code>, this will give shawn@aol.com
 what i want to do is instead of printing out shawn@aol.com i want to print out mathewkng1, age 23.</p>

<p>i tried, </p>

<pre><code>SELECT users.*, usersinfo.* FROM users, userinfo WHERE users.logon = userinfo.logon

 $logon = session_start();

if($_SESSION['logon']){
while($rows = mysql_fetch_array($user )){
$username = $rows['username '];
$age= $rows['age'];

}
echo " .$username." &lt;br&gt; ".$age." ";
}
</code></pre>

<p>i get the following error $username and $age not defined.</p>
