DJJQ Posted November 28, 2007 Share Posted November 28, 2007 Hi, I'm trying to make a regret function in php. I want this to work like if I make a mysql command with php, to have this button ready to undo the latest command made in the database. And not needing to enter by phpmyadmin etc. Anyone know how to do this? Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/ Share on other sites More sharing options...
fenway Posted November 28, 2007 Share Posted November 28, 2007 What does "latest command" mean? You can't undo things like that... if you want, use transactions and roll them back. Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/#findComment-401117 Share on other sites More sharing options...
DJJQ Posted November 28, 2007 Author Share Posted November 28, 2007 I mean for example if I make an insert via php. Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/#findComment-401122 Share on other sites More sharing options...
fenway Posted November 28, 2007 Share Posted November 28, 2007 I mean for example if I make an insert via php. Why would you want to undo it? And if you do, and you "know" about it, you have the uid, right? Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/#findComment-401142 Share on other sites More sharing options...
DJJQ Posted November 28, 2007 Author Share Posted November 28, 2007 This is the situation: I have a online booking system which by php manipulates the database. In case if someone changes a booking by mistake I want them to be able to have a rollback function that undoes the latest command made in my mysql database. I'm sorry if I explained badly earlier. Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/#findComment-401417 Share on other sites More sharing options...
fenway Posted November 28, 2007 Share Posted November 28, 2007 Why "undo"? Why not just correct it? Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/#findComment-401477 Share on other sites More sharing options...
DJJQ Posted November 29, 2007 Author Share Posted November 29, 2007 If with the term correct you mean changing back to the previous state, then yes this is what I want to do. However the user is restricted in the number of commands he can make from my interface, if for lets the user flags a booking as paid he can't change it back. If there is no simple rollback function I can of course allow the user to change it back himself. Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/#findComment-402393 Share on other sites More sharing options...
fenway Posted November 30, 2007 Share Posted November 30, 2007 The rollback in mysql is not atomic across user activity, but rather across statements... so you wouldn't be able to unflag it days later... which is probably desirable. Quote Link to comment https://forums.phpfreaks.com/topic/79244-undo-mysql-insertchange-made-by-php-function/#findComment-402912 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.