Have you looked at the HTML generated by this page? I think the problem would be obvious to you then. This will generate (if you have 20 records) 20 sets of input fields all named Quantity. You need to make that an array. Something like this:
<input type=\"text\" name=\"Quantity[]\" value=\"".$total_quantity."\" size=\"8\" maxlength=\"100\">
Or better yet
<input type=\"text\" name=\"Quantity[$item_id]\" value=\"".$total_quantity."\" size=\"8\" maxlength=\"100\">
This way you loop though this array (once submitted) and generate the correct SQL UPDATE statement.
BTW, if column ID and Quantity are non-text type fields, you shouldn't use single quotes in the SQL statement:
$sql = "UPDATE ryzex_buyandsell SET Quantity=$Quantity WHERE ID = $ID";