mhodgson Posted May 17, 2007 Share Posted May 17, 2007 Hope I make this clear. I have an update code that will update several rows of a database table in one go. It works perfectly. The problem is that when update is pressed the page refreshes (without the new inputed data) and then the user is redirected as required (but the changed data is inserted into the database as required). This pause is confusing to the user. Is there something I can do? // Check if button name "Submit" is active, do this if(isset($_POST['Submit'])) { for($i=0;$i<$totalRows_PupilDataAll;$i++){//{ //Declare the variables to enter into the tables $RA_colum[$i] = $RAcolum[$i]; $VAR_colum[$i] = $VARcolum[$i]; $id[$i] = $pupilID[$i]; /* // Set the reading age column $RAcolumn[] = 'RA_'.Year6.'_'.$month[]; //'1';// // Set the Variance column $VARcolumn[] = 'VAR_'.Year6.'_'.$month[]; //'1' ;// */ $reading_age[$i] = $_POST['scoredage'][$i]; $variance[$i] = $_POST['variance'][$i]; //Update the Reading ages table // Insert data with columns passed from Current Year $sqlRAupdate="UPDATE assessment_reading_ages SET $RA_colum[$i]='$reading_age[$i]', $VAR_colum[$i]='$variance[$i]' WHERE Pupil_ID='$id[$i]'"; $resultRAupdate=mysql_query($sqlRAupdate); } } //If the update works go to this page //This is the bit where the pause occur.... if($resultRAupdate){ //header('location: update_select_groups.php'); printf("<script type='text/javascript'> window.location='update_readingages_group_select.php' </script>"); } mysql_close(); Quote Link to comment https://forums.phpfreaks.com/topic/51817-update-pauses/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.