I wasn't clear enough, too 🙂
If you load the page you posted you'll first get a form with just one line. Whatever you submit with this form will be correctly displayed on the second form as last line with some empty lines and everything you posted with the short form on the first page correctly being there.
I think the empty lines are caused by empty data already being stored in the table.
The problem with the second form:
If you submit data typed into the first line by clicking on Save you'll get the form with a new line at the end that contains a duplicate of the last line of the form before you clicked save.
Looking at the HTML source you'll see that e.g. the first input of each line has always the same name.
The problem is: the last line wins (overwrites the values of the previous lines including the first one with the save button).
So you need to make sure that the for data is submitted as array so you can work with the complete form data and not only with the data of the last line.
Short example:
<input name="data[dbid][item_name]"...>
<input name="data[dbid2][item_name]"...>
After submitting the form you'll have something like
$_POST["data"] = array(dbid=>"aname", dbid2=>"aname2")
Thomas