kamal213 Posted May 9, 2011 Share Posted May 9, 2011 Hi guys, I have a PHP site where logged user can book appointments. I would like the system to be able to monitor which users edited and deleted an appointment or appointments (e.g 'appointment edited/last edited by...'). I already understand how to edit and delete appointments from the MySQL, but the problem is how do I display who deleted/edited the appointment/s. Please your ideas and suggestions a more than welcome. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/235908-php-delete-and-edit-system/ Share on other sites More sharing options...
phppaper Posted May 9, 2011 Share Posted May 9, 2011 create a table in MySQL for log Quote Link to comment https://forums.phpfreaks.com/topic/235908-php-delete-and-edit-system/#findComment-1212717 Share on other sites More sharing options...
Undrium Posted May 9, 2011 Share Posted May 9, 2011 Another suggestion is that you do not delete the appointments but use a status flag instead. Then you can have a column named "lastEditedBy" or something similar where you put the users ID. Quote Link to comment https://forums.phpfreaks.com/topic/235908-php-delete-and-edit-system/#findComment-1212720 Share on other sites More sharing options...
kamal213 Posted May 9, 2011 Author Share Posted May 9, 2011 Thanks for gettin back to me phppaper. How do I code it so sends all the deleted appointments to the log table? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/235908-php-delete-and-edit-system/#findComment-1212751 Share on other sites More sharing options...
kamal213 Posted May 9, 2011 Author Share Posted May 9, 2011 Thanks for your reply undrium Soz for sounding daft but I have never designed something like that befere..how would go about doing that? Thanks buddy. Quote Link to comment https://forums.phpfreaks.com/topic/235908-php-delete-and-edit-system/#findComment-1212753 Share on other sites More sharing options...
phppaper Posted May 11, 2011 Share Posted May 11, 2011 Every appointment has an id as primary key right? Just get that ID and insert into the log table with the username and the time before running the delete statement. Quote Link to comment https://forums.phpfreaks.com/topic/235908-php-delete-and-edit-system/#findComment-1213720 Share on other sites More sharing options...
kamal213 Posted May 11, 2011 Author Share Posted May 11, 2011 yes all appointments have a primary key id. I will try it out in let you kno how I get on Thanks phppaper Quote Link to comment https://forums.phpfreaks.com/topic/235908-php-delete-and-edit-system/#findComment-1213809 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.