Jim R Posted February 17, 2011 Share Posted February 17, 2011 I ran a Replace query in my database that didn't produce the results I wanted, not in the least. Is there a way I can undo it??? Quote Link to comment https://forums.phpfreaks.com/topic/227959-can-i-undo-a-replace-query/ Share on other sites More sharing options...
Jim R Posted February 17, 2011 Author Share Posted February 17, 2011 Here is the query: UPDATE wp_playerRank SET wpID = REPLACE(wpID,'0','(NULL)'); It didn't do what I wanted, and it basically got rid of every zero, not just lone 0's. So 207 became 27. Quote Link to comment https://forums.phpfreaks.com/topic/227959-can-i-undo-a-replace-query/#findComment-1175480 Share on other sites More sharing options...
PFMaBiSmAd Posted February 17, 2011 Share Posted February 17, 2011 Is there a way I can undo it??? You would need to restore the backup copy of your database that you made before you attempted to do this. If you don't have a backup of your database, for the query you executed, you would need to go through all the data values and put back in the zero's where they belong. Quote Link to comment https://forums.phpfreaks.com/topic/227959-can-i-undo-a-replace-query/#findComment-1175490 Share on other sites More sharing options...
Jim R Posted February 17, 2011 Author Share Posted February 17, 2011 The column in question, is basically mirroring WordPress category tag ID's, so I could likely copy them over with another query. Right? Quote Link to comment https://forums.phpfreaks.com/topic/227959-can-i-undo-a-replace-query/#findComment-1175491 Share on other sites More sharing options...
fenway Posted February 17, 2011 Share Posted February 17, 2011 Yeah, but you don't know how many zeros were replaced. Quote Link to comment https://forums.phpfreaks.com/topic/227959-can-i-undo-a-replace-query/#findComment-1175773 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.