You need to give the textbox the Record ID, or something that will uniquely identify it.
Because HTML requires a letter to start a name or ID then you will have to name your boxes accordingly and then split the name after submit.
PHP Code:
<form name="form1" method="post" action="">
<p>
<input name="id_1" type="text" id="id_1" value="30">
</p>
<p>
<input name="id_23" type="text" id="id_23" value="50">
<input name="text" type="text" id="id_23" value="tezxt">
</p>
<p>
<input name="id_45" type="text" id="id_45" value="4">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<?php
if(isset($_POST['Submit'])){
foreach($_POST as $key => $val){
if(strpos($key, 'id_') !== false){;
$id = split('id_', $key);
//echo $id[1] . ': ' . $val . '<br>';
$sql = "INSERT INTO table (id, amount) VALUES (" . $id[1] . "'," . $val . ")";
echo $sql . '<br>';
}
}
}
?>