perceptiveforce Newbie Poster

When a user logs in, the user is directed to a page called accountsummary.php. I have sessions enabled. I can successfully echo the inputed username, and echo the ENTIRE column of firstname and lastname for the entire table. The problem is that I do not want to echo the entire column or firstname and lastname. I only want to echo the firstname and lastname of the user name. Can anyone help with this?

This is the code for the login form on the index page:

<form action="scripts/loginaction.php" method="POST" name="hoapgform" id="hoapgform"><div style="width: 175px; cursor: default;" onmouseover="return window.status='WEB2: v3.0.95.0';" onmouseout="return window.status='';">                
<input id="OnlineID" name="OnlineID" style="width: 187px;" class="inLoginData" tabindex="1" onfocus=";" onclick=";" onkeydown="loginCK(this,event)" autocomplete="off" type="text">

<div style="padding-top: 6px;"> <div style="float: left;">Password</div></div>

<input id="Password" name="Password" style="width: 187px;" autocomplete="off" maxlength="50" class="inLoginData" onkeydown="loginCK(this,event);" tabindex="2" type="password">
<div style="padding-top: 6px;"> <div style="display: inline;"><input id="RememberOnlineID" tabindex="3" type="checkbox">

Remember Online ID </div><div style="display: inline; padding-top: 2px;"></div>

</div> <label> <input name="login" type="image" id="login" value="Submit" src="images/login.gif" />  </label>     </div>

    <div class="loginItem"><a href="" title="Need Help Logging In?" target="_parent">Need Help Logging In?</a></div>
    <div class="loginItem"><a href="" title="Get Your Login ID" target="_parent">Get Your Login ID</a></div>

this is the loginaction.php:

session_start( );


if ($OnlineID &&$Password)

$connect = mysql_connect($dbServer, $dbUser, $dbPass) or die("Could not connect to mysql server.");

mysql_select_db("$dbDatabase") or die ("The Site down for scheduled maintenance. Please try back later. We are sorry for the inconvenience.");


$query = mysql_query("SELECT * FROM swilregion132 WHERE OnlineID='$OnlineID'");

$numrows = mysql_num_rows($query);

if ($numrows !=0)

    while ($row = mysql_fetch_assoc($query)) // code to log ...