Updating database problem

I have been trying to update info in my database all day. Can someone tell me why my code won’t update info currently in the database???

Thanks!

<font face="Arial">
<?php
  // story_submit.php
  // add / modify story record

  include_once('header.php');
?>
<br><div align="center"><table border="0" width="500">
    <tr>
        <td>
        <h1><font face="Arial" color="#0066CC">Update Info</h1></font>
        </td>
    </tr>
</table><table border="0" width="520"><tr>
<td><font face="Arial">
<?php
  
    if (!$salesperson || !$client || !$project || !$address || !$contactname1 || !$contactphone1 || !$contactemail1 || !$contactname2 || !$contactphone2 || !$contactemail2 )
  {
     echo '<font color="red">You have not entered all the required details.<br />'
          .'Please go back and try again.</font>';
  }
  if (!get_magic_quotes_gpc())
  {
    $salesperson= addslashes($salesperson);
    $client = addslashes($client);
    $project = addslashes($project);
    $address = addslashes($address);
    $contactname1= addslashes($contactname1);
    $contactphone1 = addslashes($contactphone1);
    $contactemail1 = addslashes($contactemail1);
    $contactname2= addslashes($contactname2);
    $contactphone2 = addslashes($contactphone2);
    $contactemail2 = addslashes($contactemail2);
  }


if ( $salesperson )
{
    echo '<p><b>Thank You </b>';
    echo $salesperson.'</b><b><p><h3></font><font face="Arial" color="#0066CC">Here is the information entered on this new lead:</h3></font><font face="Arial" color="#000000"></b></p>';
}
else
{
    echo '<p><b>Who Are You?: </b>';
    echo '<font color="red">You did not enter <b>Your Name</b>.</font><br />';
}

if ( $client )
{
    echo '<p><b>Name: </b>';
    echo $client.'<br />';
}
else
{
    echo '<p><b>Lead Name: </b>';
    echo '<font color="red">You did not enter a <b>Client Name</b>.</font><br />';
}

if ( $project )
{
    echo '<p><b>Project Name: </b>';
    echo $project.'<br />';
}
else
{
    echo '<p><b>Project Name: </b>';
    echo '<font color="red">You did not enter a <b>Project Name</b>.</font>';
}

if($projecttype == 'Live Sound Reinforcement')
  echo '<p><b>Project Type: </b>Live Sound Reinforcement</p>';
elseif($projecttype== 'System Design Integration')
  echo '<p><b>Project Type: </b>System Design & Integration</p>';

  
if($type == 'Lead')
  echo '<p><b>Type: </b>Lead</p>';
elseif($type== 'Client')
  echo '<p><b>Type: </b>Client</p>';



if ( $address )
{
    echo '<p><b>Address: </b>';
    echo $address.'<br />';
}
else
{
    echo '<p><b>Address: </b>';
    echo '<font color="red">You did not enter an <b>Address</b>.</font>';
}

if ( $contactname1 )
{
    echo '<p><b>Contact 1: </b>';
    echo $contactname1.'<br />';
}
else
{
    echo '<p><b>Contact 1: </b>';
    echo '<font color="red">You did not enter a <b>Contact 1 Name</b>.</font>';
}

if ( $contactphone1 )
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Phone: </b>';
    echo $contactphone1.'<br />';
}
else
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Phone: </b>';
    echo '<font color="red">You did not enter a <b>Contact 1 Phone</b>.</font>';
}

if ( $contactemail1 )
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Email: </b>';
    echo $contactemail1.'<br />';
}
else
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email: </b>';
    echo '<font color="red">You did not enter a <b>Contact 1 Email</b>. (Put "N/A" if none)</font>';
}

if ( $contactname2 )
{
    echo '<p><b>Contact 1: </b>';
    echo $contactname2.'<br />';
}
else
{
    echo '<p><b>Contact 1: </b>';
    echo '<font color="red">You did not enter a <b>Contact 1 Name</b>.</font>';
}

if ( $contactphone2 )
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Phone: </b>';
    echo $contactphone2.'<br />';
}
else
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Phone: </b>';
    echo '<font color="red">You did not enter a <b>Contact 1 Phone</b>.</font>';
}

if ( $contactemail2 )
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Email: </b>';
    echo $contactemail2.'<br />';
}
else
{
    echo '<b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email: </b>';
    echo '<font color="red">You did not enter a <b>Contact 1 Email</b>. (Put "N/A" if none)</font>';
}

if ( $status )
    echo '<b><br>Status: </b>';
    echo $status.'<p>';


$username = "dbo";
$password = "hjghjghj";
$database = "db27";
$hostname = "db"; 

//connection to the database
$handle = mysql_connect($hostname, $username, $password, $database)
 or die("");
echo "";

//select a database to work with
$selected = mysql_select_db("db274302009",$handle)
  or die("Could not select db274302009");
    
    
  $salesperson = $_POST['salesperson'];
  $client = $_POST['client'];
  $project = $_POST['project'];
  $projecttype = $POST['type'];
  $type = $POST['projecttype'];
  $address = $_POST['address'];
  $contactname1 = $_POST['contactname1'];
  $contactphone1 = $_POST['contactphone1'];
  $contactemail1 = $_POST['contactemail1'];
  $contactname2 = $_POST['contactname2'];
  $contactphone2 = $_POST['contactphone2'];
  $contactemail2 = $_POST['contactemail2'];
  $status = $_POST['status'];
  $type = $_POST['type'];
  $projecttype = $_POST['projecttype'];
  $city = $_POST['city'];
  $state = $_POST['city'];
  $zip = $_POST['city'];
  $time = date('F jS');
    
 
      $query = "update clienttable
                set salesperson = '$salesperson', 
                client = '$client',
                page = '$project',
                projectype = '$projecttype'
                type = '$type', 
                address = '$address',
                contactname1 = '$contactname1',
                contactphone1 = '$contactphone1'
                client = '$contactemail1',
                page = '$contactname2',
                projectype = '$contactphone2'
                type = '$contactemail2', 
                status = '$status', 
                modified = '$time'
                where id = '$id'";

$result = mysql_query($query, $handle);

  if (!$result) 
  {
    echo "There was a database error when executing <pre>$query</pre>";
    echo mysql_error();
    exit;
  }

?>
<?php
}
?>     </td>
    </tr>
</table>