I am writing a jQuery powered tool that can copy MySQL databases from one server to another one. In order to support also large tables I want to copy the rows in batches. But it doesn't seem to work. Can someone please have a look and see if I have done something wrong? main file ffunction copyRows(panel,db,tb,start,max) { busy(panel,'Copying Rows '+start); alert('ajax/copyRows.php?p='+panel+'&db='+db+'&tb='+tb+'&start='+start+'&max='+max); $.getScript('ajax/copyRows.php?p='+panel+'&db='+db+'&tb='+tb+'&start='+start+'&max='+max, function () { busy(panel,msg); if (start !== false) { copyRows(panel,db,tb,start,max) } }); } Code (markup): copyRows.php note: sql code has been stripped. But if I load the file correctly all output is correct. <?php if ($total == $current) { echo 'msg = \'Finished Copying Rows.\';'; echo 'start = false;'; } else { $current = $result['tot']; echo 'start = '.($_GET['start']+$_GET['max']).';'; echo 'msg = \'Copied '.$current.' of '.$total.' rows.\';'; } ?> Code (markup): The problem I seem to have is that even though the copyRows.php file creates the right output, if I do an alert(start); in the main file after I do the call to copyRows.php, the start variable doesn't change but the msg Any Idea on what I do wrong?