I just collected it all afternoon, and suddenly I found that some more characters were collected in the title field, and these characters were all the same.
During the collection, an extra <img src=images/hot.gif> was collected. Although these characters did not take up much space, it was not very unpleasant. However, there was a big problem when growing the homepage and it could not be displayed. I was very depressed. Yeah.
So I tried to find a solution.
First, I tried to modify the records one by one by directly entering dedecms, but my God, there are more than 3,000 data. After changing them one by one, I might as well go to human flesh to update them myself. It is really too painful.
If it didn't work, I simply started from the root cause and directly modified the database. So I downloaded a phpmyadmin and started trying to solve it through SQL statements.
When I first started, I used query statements to search.
select from 'dede_art; where title like %<img src=images/hot.gif>%
So many,
More than 1,000 pieces of data were queried. I was secretly glad that I didn't change any of them, otherwise everyone would die.
Later, I found a brother of mine. He is very strong in ASP and can develop programs independently using SQL2000. He wrote me a statement. It was very long and complex. It was nested layer by layer. The result was an execution error. This sentence I won’t write anything else.
Then I used phpmyadmin again and wanted to write a short PHP statement. Unfortunately, my PHP skills were not good enough and I had no choice but to write it out.
So I asked another question, googled it (rejecting Baidu), and found a very cool word replace, so I tried to see if I could use this function.
Here is the statement I wrote:
update `dede_art` set /> was executed all at once, and no error was reported. I thought I made a mistake again, but I didn’t expect to find when I browsed, hey, <IMG border=0 src=Images/hot.gif> was gone. Cool.
So I wrote this article, hoping it will be helpful to everyone.
Key methods:
update 'Table name (such as dede_art in my case)' set To modify the field name = replace (To modify the field name, 'Specific characters to be replaced', 'Replaced characters')
I hope Buzhu can give me the essence. I have been thinking about the essence for so many years.