I have printed the table get from database like below

And my code
print "<form id='form1' name='form1' method='post' action='http://localhost/live/index.php?m=sync&a=update'>";
while($db_field = mysql_fetch_assoc($result))
{
print "<table border=1 width=100%>";
print "<tr><td width=5%><input name='taskid' type='text' value=".$db_field['task_id']." readonly=readonly></td>";
/*print "<td width=10%>".$db_field['task_name']."</td>";*/
print "<td width=5%><input name='percent' type='text' value=".$db_field['task_percent_complete']." readonly=readonly></td>";
print "</table>";
}
print "<input name='Sync' type='submit' value='Sync' id='Sync' />";
print "</form>";
mysql_close($db_handle); /*.$db_handle */ /*<---to check the resource link and id*/
}
else{
print"Failed" ;//.$db_handle;
So what i want to know how to parsing all the datas from the database to another page like the action i want to send, because now i just can parsing 1 data in 1 table when i click the sync button like below is my parsing code in another page
The image below is the parsing code

I have no idea how to display all the data in new page…it is need to use loop? im newbie, big thanks
Edit based on comments below:
For starters, in the first code, move the
print "<table border=1 width=100%>";andprint "</table>";parts outside thewhileloop because the table is getting generated twice as two separate tables.What’s happening with the current code is that the second pair of fields
taskidandpercentare overwriting the first because the names are the same, so you only see the second pair of values in your screenshot. You need to make the input field names an array: put square brackets[]in the name so thattaskidandpercentare automatically arrays in$_POST. This is what the HTML source should look like in the form:(Or manually subscript them like
taskid_0,percent_0andtaskid_1,percent_1; but then you have to decide when to stop looping or use variable variables.)After that, in the target page where you are processing
$_POST["taskid"], it will be an array which you can access as$_POST["taskid"][0],$_POST["percent"][0]and$_POST["taskid"][1],$_POST["percent"][1]. So loop through that when updating the database and generating your 2nd html:Hope that helps.
Some pointers: 1. Don’t put images of your code, just paste the code. 2. The generated HTML copy-pasted (browser -> view source) is more useful than an image of the page.
version 1:
1. If I understand it correctly, you want to show the form on one page and when the user clicks
Sync(sumbit) you want it to go to another page which will process the form?Use the
targetattribute of the<form>element (link). Like:Or,
2. If you want to process the form first (same page) and send the user to another page:
send an HTTP 302 re-direct + Location header.
You can also set the redirect in your HTML after processing the page using: