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 Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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.