Hi guys,
I am having some problems displaying data in dynamic form. It always displays the last saved data, instead of the latest one retrieved from the database.

Here is the code to retrieve the data:-
Code PHP:
if(isset($_POST['edit_budget'])){
	$travel_request=getInfoTravelBudget($_POST['edit_budget']);
	for($b=1;$b<count($travel_request);$b++){
		$_POST['departure']=$travel_request[$b][5];
		$_POST['destination']=$travel_request[$b][4];
		$_POST['departure_date']=$travel_request[$b][6];
		$_POST['return_date']=$travel_request[$b][7];
		$_POST['travel_mode']=$travel_request[$b][8];
		$_POST['quantity'.$b]=$travel_request[$b][11];
		$_POST['person_name'.$b]=$travel_request[$b][12];
		$_POST['currency'.$b]=$travel_request[$b][13];
		$_POST['rate'.$b]=$travel_request[$b][14];
		$_POST['unit_price'.$b]=$travel_request[$b][15];
		$_POST['amount'.$b]=$travel_request[$b][16];
		$_POST['amount_total'.$b]=$travel_request[$b][17];           
	}
}

And this is the code to display it:-

Code PHP:
for ($j = 1; $j < mysql_num_rows($result)+1; $j++){
				print "<tr>";
				print $_POST['quantity'.$j];
				print "<td><input type='checkbox' id='checkbox".$j."' name='enable".$j."' value='1'  /></td>";
				print "<td><input type='text' name='item_description".$j."' value='".$result_array['budget_item']."' /></td>";
				print "<td><input type='text'  name='quantity".$j."' value='".$_POST['quantity'.$j]."' ".$field_status."/></td>";
				print "<td><input type='text' name='currency".$j."'  value='".$_POST['currency'.$j]."' /></td>";
				print "<td><input type='text' name='rate".$j."'  value='".$_POST['rate'.$j]."' /></td>";
				print "<td><input type='text'  onkeyup='checkvalue(".$j.")' name='unit_price".$j."' value='".$_POST['unit_price'.$j]."' /></td>";
				print "<td><input type='text' name='amount".$j."' value='".$_POST['amount'.$j]."' ".$field_status."/></td>";
				print "<td><input type='text' name='amount_rm".$j."' value='".$_POST['amount_rm'.$j]."' /></td>";
				print "</tr>";
			}
		}

BTW I have simplified the code a little. I have also checked to make sure that the function getInfoTravelBudget return results from the db, and it does.