如何通过比较php中的电子邮件和id来更新查询

Hi i need to update a query by comparing id and email but if i give id in where condition it is not working.Here is my code.

index.php

<td style="width:21%;"><a class="button add" href="editsalaries.php?id=<?php echo $row['user_id'];?>">Edit Salary Details</a></td>

editsalaries.php

<form method="post" action="updatesalaries.php" id="myform">
<input type='hidden' value="<?php echo $username; ?>" name='email'> 
<?php  include "editsalary.php";?>
<table style="border-collapse: collapse;border: 1px solid black;width:44%;">
<label>Company Name</label>
<input type="text" name="company_name" value="<?php echo $row['company_name'];?>" />
 <label>Name</label>
<input type="text" name="user_name" value="<?php echo $row['user_name'];?>" />
<button type="submit"  class = "medium" style="background-color: #2daebf;">Save</button>

updatesalaries.php

$id=$_GET['id'];
$email=$_POST['email']; 
$companyname=$_POST['company_name'];
$name=$_POST['user_name'];
$query=mysql_query("UPDATE user_salary_details SET
       company_name='$companyname',user_name='$name'WHERE email='$email' AND user_id='$id'  
");

editsalary.php

$id=$_GET['id']; 
$res = "SELECT *
FROM user_salary_details
WHERE email ='$username'
AND user_id='$id'";
$result=mysql_query($res);
$row = mysql_fetch_array($result);

The form in the first code section does not have any control named id, which means that $_GET['id'] will not be populated in updatesalaries.php. Place the user id into a session variable or into a hidden control.