Hi guys, Im trying to update multiple tables which are being called from the user_id, but when i click update it updates every row

What can I do?


editalert.php

PHP Code:
<form action="alertsupdated.php" method="GET">
<?php


//connect to your database ** EDIT REQUIRED HERE **
mysql_connect("localhost","notexper_two","three"); //(host, username, password)

//specify database ** EDIT REQUIRED HERE **
mysql_select_db("notexper_one") or die("Unable to select database"); //select which database we're using




$sql = ("select * from jobalerts WHERE user_id = '"$_SESSION['seeker'] ."'");
  


$result mysql_query ($sql);
 while (
$row mysql_fetch_array($result))



        

              {
              


$alertid$row['alertid'];
$location$row['location'];    
$category$row['category'];             
  
                        
$alllocation= array(
'Avon',
'Bedfordshire',
'Berkshire',
'Buckinghamshire'
'Cambridgeshire',
'Cheshire',
'Cleveland',
'Cornwall',
'Cotswolds',
'Cumbria',
'Derbyshire',
'Devon' ,
'Dorset',
'Durham',
'East Anglia'
'East Midlands',
'East Sussex',
'Essex' ,
'Gloucestershire'
'Greater London'
'Greater Manchester'
'Hampshire'
'Herefordshire',
'Hertfordshire' ,
'Humberside'
'Isle of Wight'
'Isles of Scilly'
'Kent'
'Lake District',
'Lancashire'
'Leicestershire'
'Lincolnshire'
'Merseyside'
'Norfolk',
'North Yorkshire'
'Northamptonshire'
'Northumberland',
'Northumbria'
'Nottinghamshire'
'Oxfordshire',
'Rutland',
'Shropshire'
'Somerset'
'South Yorkshire',
'Staffordshire',
'Suffolk',
'Surrey',
'Tyne and Wear',
'Warwickshire',
'West Country' ,
'West Midlands' ,
'West Sussex'
'West Yorkshire'
'Wiltshire'
'Worcestershire'
'Yorkshire');

$allcategory= array(
'AeroSpace',
'Agriculture,Fishing,Forestry',
'Banking,Insurance,Finance',
'Catering & Hospitality',
'Construction',
'Customer services,Call centres',
'Catering & Hospitality',
'Education',
'Electronics',
'Engineering,Manufacturing,Utilities',
'Forestry',
'Graduate',
'health, Nursing',
'human resources',
'IT & Internet',
'Legal',
'Management consultancy',
'Marketing,Advertising,PR',
'Media, New media,Creative',
'Not for profit,Charities',
'Property',
'Public sector & Services',
'Recruitment sales',
'Retail,Wholesale',
'Sale');

        


echo 
"<table width=100%><Tr>";

echo 
"<td width=20% VALIGN=TOP><font size=3>$alertid";
echo 
"</td><td width=30% VALIGN=TOP>";
echo 
"<select name='location'>";
foreach(
$alllocation as $e) {
   
$selected = ($e == $location) ? 'selected="selected"' '';
   echo 
"<option value='$e$selected>$e</option>\n";
}
echo 
"</select>
</td>

<td width=30%>"
;
echo 
"<select name='category'>";
foreach(
$allcategory as $f) {
   
$selected = ($f == $category) ? 'selected="selected"' '';
   echo 
"<option value='$f$selected>$f</option>\n";
}
echo 
"</select>





</td>
"
;

echo 
'<TD width=20% VALIGN=TOP align=right><input type="checkbox"></TD>';

echo 
"</tr></table>
<br>

"
;

}
?>

alertupdated.php



PHP Code:
<?php
{


$dbhost 'localhost';
$dbuser 'notexper_two';
$dbpass 'three';

$conn mysql_connect($dbhost$dbuser$dbpass) or die ('Error connecting to mysql');

$dbname 'notexper_one';
mysql_select_db($dbname);

$id $_GET['id'];



$query=("UPDATE jobalerts SET 
location='" 
$_GET['location'] . "',
category='" 
$_GET['category'] . "'  where user_id = '"$_SESSION['seeker'] ."'");

   

                       

mysql_select_db($dbname) or die( "Unable to select database");
mysql_query($query);


echo 
"jobupdated";

// Send Password to email



//connect to your database ** EDIT REQUIRED HERE ** 

mysql_connect("localhost","notexper_two","three"); //(host, username, password) 



//specify database ** EDIT REQUIRED HERE ** 

mysql_select_db("notexper_one") or die("Unable to select database"); //select which database we're using 



     



$sql = ("select * from members where user_id = '"$_SESSION['logged_in'] ."'"); 



             
$result mysql_query ($sql); 



             
$row mysql_fetch_array($result);



// send email 



$to      $row["user_email"];





$subject 'Your job has been updated'



$message 'Thank you for for updating your job'



$headers 'From: support@notexperienced.co.uk'


if(!
mail($to$subject$message$headers))



 
mysql_close();


  }


































?>