maliary Posted May 13, 2007 Share Posted May 13, 2007 Hi, I have this code that I am using to delete records from the database. It is deleting the records alright but the display out put is not reflected immediately after clicking to the delete button. I have to refresh the page or click on the button again for the record to disappear. The form is getting called on the same page. echo "<td><nobr> ".$tp['lo_toxic']." </nobr></td>"; echo "<td><nobr> ".$tp['hi_toxic']." </nobr></td>"; echo '<td> <a href="labor_delete_param_admin.php?nr='.$tp['nr'].'"><img '.createLDImgSrc($root_path,'delete_sm.gif','0').'></a> </td>'; labor_delete_param_admin.php this page has both the delete and display code. The delete code $results = $db->Execute("DELETE FROM $dbtable WHERE nr= $nr"); I know for sure having the delete on a separete page would do the trick but isn't it possible on the same page? Quote Link to comment https://forums.phpfreaks.com/topic/51161-delete-and-refresh/ Share on other sites More sharing options...
paul2463 Posted May 13, 2007 Share Posted May 13, 2007 if you had the delete code on another page then brought it straight back to your main page after the deletion then it should refresh the page on reload. Quote Link to comment https://forums.phpfreaks.com/topic/51161-delete-and-refresh/#findComment-251904 Share on other sites More sharing options...
maliary Posted May 13, 2007 Author Share Posted May 13, 2007 Thanks, But, Is it possible to do this without going out to another page and coming back. Quote Link to comment https://forums.phpfreaks.com/topic/51161-delete-and-refresh/#findComment-251918 Share on other sites More sharing options...
paul2463 Posted May 13, 2007 Share Posted May 13, 2007 I take it you are using $_SERVER['PHP_SELF'] to refresh the php code on your page, this should then refresh the page anyway Quote Link to comment https://forums.phpfreaks.com/topic/51161-delete-and-refresh/#findComment-251926 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.