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??? 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. 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. 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? 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. 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
Archived
This topic is now archived and is closed to further replies.