Pass these values to hidden fields. These fields are called through ajax to send data to next-page to update.
<input type='hidden' value="<?echo $costo_sem;?>" class="costosemanal">
<input type='hidden' value="<?echo $fi;?>" class="fechai">
<input type='hidden' value="<?echo $ff;?>" class="fechaf">
echo "<script>
var r = confirm('OK to update, CANCEL to do nothing');
if(r === false){
document.location.href = 'costos.php';
}else{
var costosemanal=$('.costosemanal').val();
var fechai=$('.fechai').val();
var fechaf=$('.fechaf').val();
$.ajax({url:'UpdatePage.php?costosemanal='+costosemanal+'&fechai='+fechai+'&fechaf='+fechaf,cache:false,success:function(result){
alert('Updated');
}});
}
</script>";
Add one UpdatePage.php to update your query.
UpdatePage.php
<?
$costosemanal=$_GET['costosemanal'];
$fechai=$_GET['fechai'];
$fechaf=$_GET['fechaf'];
$update = "UPDATE tbl_costos SET costo_semanal = '$costosemanal' WHERE fechai = '$fechai' AND fechaf ='$fechaf' ";
//Write Mysql Command To Update This Query
?>