1th: Dream dedecms articles are stored in three tables respectively [Addonarticle],[archives],[arctiny] through Addonarticle.aid, Archives.id, Arctiny.id Association, When you delete an article, you should delete the three-table record.
2nd: Execute SQL can be from phpMyAdmin, or DEDECMS background system Setup-sql command line tool
3rd: The manual deletion of the content is empty or less than 200 of the article, divided into two steps to delete two separate tables, the summary code is as follows:
1: View the code to delete the article:
The code is as follows |
Copy Code |
SELECT * from addonarticle where length (body) <200 |
2: Delete the content table.
The code is as follows |
Copy Code |
Delete from addonarticle where length (body) <200 Delete from addonarticle where length (body) <200 |
3: View the code for the second table where you want to delete the article:
The code is as follows |
Copy Code |
Left join Addonarticle T2 in T1.id=t2.aid 04.where t2.aid is null and t1.channel=1 SELECT * From Archives t1 Left join Addonarticle T2 on T1.id=t2.aid Where T2.aid is null and t1.channel=1
|
4: Delete the second table.
The code is as follows |
Copy Code |
Left join Addonarticle T2 to T1.id=t2.aid 04.where t2.aid is null and t1.channel=1 DELETE archives From Archives t1 Left join Addonarticle T2 on T1.id=t2.aid Where T2.aid is null and t1.channel=1
|
5, view the code to delete the third table of articles:
The code is as follows |
Copy Code |
Left join Addonarticle T2 in T1.id=t2.aid 04.where t2.aid is null and t1.channel=1 SELECT * From Arctiny T1 Left join Addonarticle T2 on T1.id=t2.aid Where T2.aid is null and t1.channel=1
|
6: Delete the third table.
The code is as follows |
Copy Code |
Left join Addonarticle T2 in T1.id=t2.aid 04.where t2.aid is null and t1.channel=1 |
If you do not see, you can directly perform the 2,4,6 step, where t1.channel=1 is only to manipulate the meaning of ordinary article categories, to prevent deletion of other categories such as software.