kundan Posted January 5, 2009 Share Posted January 5, 2009 Hello Sir, how can we delete the records using button control in php.I tried a lot but in vain?please help me out in this regard. Thanks in advance. Kundan Link to comment https://forums.phpfreaks.com/topic/139495-deleting-records-using-button-control/ Share on other sites More sharing options...
ram4nd Posted January 5, 2009 Share Posted January 5, 2009 Depends on what records you want to delete. You are talking about files or sql data or something else? Link to comment https://forums.phpfreaks.com/topic/139495-deleting-records-using-button-control/#findComment-729752 Share on other sites More sharing options...
kundan Posted January 5, 2009 Author Share Posted January 5, 2009 I am displaying the Mysql tables data in a table along with delete button i want to delete the record when the delete button is clicked with confirmation Link to comment https://forums.phpfreaks.com/topic/139495-deleting-records-using-button-control/#findComment-729764 Share on other sites More sharing options...
vbnullchar Posted January 5, 2009 Share Posted January 5, 2009 you can create a php script that deletes that record then attach it to the onclick event of the button.. or ajax request Link to comment https://forums.phpfreaks.com/topic/139495-deleting-records-using-button-control/#findComment-729767 Share on other sites More sharing options...
kundan Posted January 5, 2009 Author Share Posted January 5, 2009 could please tell how to attach the php script to delete button either with on click event or ? Kundan Link to comment https://forums.phpfreaks.com/topic/139495-deleting-records-using-button-control/#findComment-729773 Share on other sites More sharing options...
kundan Posted January 5, 2009 Author Share Posted January 5, 2009 Thanks alot sir it has worked out using another php page script. but i have directed the new php page by using javascript with window.location <input type='button' name='DELETE' value='DELETE' onclick='return del($empno);')> <script> function del(empno) { var answer = confirm ("Are you sure you want to delete the data ?") if (answer) { window.location="empdelete.php?empno="+empno; return true; } else { return false; } } </script> but instead of directing to another page can we do it in the same page. Kundan Link to comment https://forums.phpfreaks.com/topic/139495-deleting-records-using-button-control/#findComment-729793 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.