php - How to remove htmlentities() values from the database? -


I knew nothing before long - not that I still know a lot - I have a web app in php After creating the category of MySQL database that runs my data through htmlentities () . I finally came into my senses and removed this step and got stuck in production instead of input and went on my way to pleasure

Still, I had to see some old figures again and unfortunately I have a problem with, when displayed on the screen, I am getting the displayed value which are effectively involved twice effectively.

So, there is a MySQL or phpmyadmin way of converting all old, affected rows into their relevant characters, or I have to write a script to read, decode and update all 17 million rows of each row 12 tables?

Edit:

Thank you for everyone, I wrote my own answer below in some code, it is not very good, but this test data first Someone used to indicate a glitch error in my code when I am on bed, I have to run it on backup db tomorrow and then on live if it works fine then

< Div class = "post-text" itemprop = "text">

I ended up using it, not beautiful, take Qin I am tired, it is 2 o'clock and this work! (Edit: on test data)

  $ tables = array ('user', 'users_more', 'users_extra', 'forum_posts', 'posts_edits', 'forum_threads', 'order' , 'Products_comments', 'products', 'favorites', 'blocked', 'notes'); Foreign exchange ($ tables $ table) {$ sql = "SELECT * FROM {$ table} WHERE data_datas & lt; '{$ encode_cutoff}'"; $ Rows = $ databases- & gt; Query ($ sql); While ($ line = mysql_fetch_assoc ($ rows)) {$ new = array (); Forex Currency ($ line as $ line = & gt; $ data) {$ new [$ key] = $ database-> Escape_value (html_entity_decode ($ data, ENT_QUOTES, 'UTF-8')); } Array_shift ($ new); $ New_string = ""; $ I = 0; Forex Currency (new $$ as new_key => $ new_data) {if ($ i> 0) {$ new_string = ","; } $ New_string = $ New_key "= '" $ New_data "'; $ I ++; } $ Sql ​​= "UPDATE {$ table} SET" $ New_string "WHERE id = '" $ line [' id '] "'"; $ Database- & gt; Query ($ SQL); // plus to check some code}}  

Comments