This solution may be quite tricky or lengthy even, sorry for that but it worked very well in a long run and was easy to debug to.
Step 1 maintain a hidden textbox
holding the row count of the table you create.
example $ count=count ($ user_listings);
step 2 process each value using for each
Step 3 inside for each on creating table create dynamic id for the textboxes
For ex <input id='<?php echo "listing_header".$iteratedvalue?>'></input>
On submit function
Process it the same way and fetch the values from the $post[dynamic ids]
Example
<? php $ value = $ POST ["listing_header". $ iteratedvalue ?>