<div style="font-family:tahoma; color:#F00; ">
if (isset($_SESSION['user']))

echo "You are logged in as ".$_SESSION['user'],  " to log out click <a href =logout.php>here</a>";

die ("Please Register <a href =register.php>here</a>");?>



$username = $_SESSION['user'];
   header("location: login.php");

    $query=" SELECT * FROM users WHERE user='$username'";

while ($i < $num) {


$query1="UPDATE users SET FirstName = '$u_fn', SecondName='$u_sn', Gender='$u_gen', Email='$u_email', Location=$u_location, user= $u_username, password='$u_password',";  

echo "Record Updated";


<div id = "registercontent">
<h1> Edit your profile information here!</h1><br />
<form id='profile' style="text-align:left;" action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post'
<fieldset >
<legend><b>Enter details to create an account</b></legend>
<input type='hidden' name='submitted' id='submitted' value='1'/><br />

<label for='FirstName' >First Name:              </label>
<input type='text'  name='FirstName' id='FirstName'  "maxlength="50" value = '<?php echo $fn ?>' /><br /><br />

<label for='SecondName' >Second Name:</label>
<input type='text' name='SecondName' id='SecondName' maxlength="50" value = '<?php echo $sn ?>'/><br /><br />

<label for='gender' >Gender :</label>
<input type="radio" name="gender1" <option value='<?php echo $gen ?>'>Male</option>
<input type="radio" 
name="gender2" value="female">Female<br><br />

<label for='Email' >Email Address:</label>
<input type='text' name='Email' id='Email' maxlength="50" value = '<?php echo $email ?>'/><br /><br />

<label for='Location' >Location :</label>
<input type='text' name='Location' id='Location' maxlength="50"value = '<?php echo $location ?>' /><br /><br />

Please select your sports of interest from the list :<br /><br />

<select size="5" name="sport" multiple >
<option selected>
<option>Beach Volleyball
<option>Canoe Slalom
<option>Canoe Sprint
<option>Cycling - BMX
<option>Cycling - Mountain Bike
<option>Cycling - Road
<option>Cycling - Track
<option>Gymnastics - Artistic
<option>Gymnastics - Rhythmic
<option>Modern Pentathlon
<option>Synchronised Swimming
<option>Table Tennis
<option>VolleyballWater Polo
<i>(Hold CTRL while selecting sports)</i>
<br /><br />

Please create a username and password you will use to sign in :<br /><br />
<label for='username' >Username: </label>
<input type='text' name='username' id='username' maxlength="50"value = '<?php echo $username ?>' /><br /><br />

<label for='password' >Password: </label>
<input type='password' name='password' id='password' maxlength="50"value = '<?php echo $password ?>' /><br /><br />

<label for='repeatpass' >Repeat Password: </label>
<input type='password' name='repeatpass' id='repeatpass' maxlength="50" value = '<?php echo $password ?>'/><br /><br />

<input type="Submit" value="Update">
<input type="Submit" value="Cancel">


<div style="font-family:tahoma; color:#F00; ">

i am having problems with my updating to the database, the information is shown in the form but when i click update it is not updating to the database, but is just refreshing the page... any help?

Do this:

mysql_query($query1) or die(mysql_error());

Most likely it will complain about missing quotes.

While we're waiting on your reply, you might consider cleaning up your HTML:
Line 6. <a href="logout.php">
Line 9. <a href="register.php">
Line 84. maxlength="50" value="<?php echo $location ?" />
Lines 89 - 123. None of the option tags have a corresponding closing </option> tag. Example:

<option selected></option>

Line 131. See 84.
Line 134. See 84.
Line 137. See 84.