I assume what you are wanting to is create a form to update multiple rows (in this case, updating the health for multiple ships when the form submits).
If I'm correct, then what I would do is either:
1) Create a hidden element for each ship id
while($row = mysql_fetch_assoc($result))
echo '<input type="hidden" name="shipid[]" value="'.$row['shipId'].'" />';
Then when you submit the form, $_POST['shipid'] will be an array of the id's
2) Create a comma delimited list in the single hidden element
$id_list = NULL;
while($row = mysql_fetch_assoc($result))
$id_list .= $result['shipId'];
echo '<input type="hidden" name="shipid" value="'.rtrim($id_list, ',').'" />';
rtrim is removing the comma added at the last iteration of the loop, and then when you submit the form you can do
$ids = explode(',', $_POST['shipid']);
And $ids will be an array of the ships
Hope that helps