PHP脚本不更新sql

Here is my code.

<center>
<html>
<body>
<form method="post" name="AwardList" action="<?php echo $_SERVER['PHP_SELF']?>">
<script>
function awardSort($ID)
{
document.AwardList.hiddenID.value = $ID;
document.AwardList.submit();
}
</script> 
<table border=1>
<input type="hidden" name="hiddenID" />
<tr>  
<th><b>Award</b></th>
<th><b>Issue ID</b></th>
<th><b>Sort #</b></th>
<th><b>Submit</b></th>
</tr>

<?php
$userid = ($vbulletin->userinfo['userid']);
$query = ("select a.*, userdisplayorder, issue_id from award a join award_user aw on a.award_id = aw.award_id where aw.userid = '$userid'");   

if (isset($_POST['submit'])){
$userdisplayorder = mysql_real_escape_string($_POST['userdisplayorder']);
echo $_POST[hiddenID];
echo '<br>';
echo $userdisplayorder; 

$sql = mysql_query("UPDATE award_user SET userdisplayorder='$userdisplayorder' WHERE userid='$userid' AND issue_id='$_POST[hiddenID]'");
}

$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)){

$awardimgurl = $row['award_img_url'];
$ID = $row['issue_id'];
$userdisplayorder = $row['userdisplayorder'];

  echo '<tr>';        
  echo '<th>'; echo "<img src='$awardimgurl'>"; echo '</th>';                    
  echo '<th>'; echo '<input type="text" name="issueid" readonly="readonly" value="' . $ID . '" size="5">'; echo '</th>';
  echo '<th>'; echo '<input type="text" name="userdisplayorder" value="' . $userdisplayorder . '" size="5">'; echo '</th>';
  echo '<th>'; echo "<center><input type='submit' name='submit' value='Submit' onclick=awardSort('$ID')></center>"; echo '</th>';
  echo '</tr>';      
}               
?>   
</table> 
</html></center> 

It looks like this on a webpage:

EDIT: Here is some additional info.

I modified the code to see what it was printing

Results:

The award issue id is fine now. However, the sort # is not working. If I change the first award with issue_id 88 to Sort # 3, it will just go back to 0. However, I can change issue_id 14537's sort # to anything, and it will work. Say I change issue_id 14537's sort # to 5, then I go and change issue_id 5's sort # to 3, it will go to 5. It's using whatever value is in Sort # for issue_id 14537 instead of it's own. I tried to make a function for the $userdisplayorder to make it unique like $ID is, however, i can't figure out how to do two onclick's.