Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
SQL query to delete comment spam ?
Posted: 20 June 2004 11:10 AM   [ Ignore ]  
Summer Student
Total Posts:  10
Joined  2003-08-18

The comment spammers are at it again. Timedelaying post doesn’t work efficiently.
Is there a SQL query to delete ALL unwanted comments (search ie. European Union leaders…), that can be executed with PHPMyAdmin?

I just want to delete all comments or one string in 1 sweep.

See http://www.applebits.com for examples of comment spam strings.

Profile
 
 
Posted: 04 July 2004 06:16 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  8
Joined  2003-02-10

Hmmm. If you’re using MySQL 4.x you can do fulltext searches in SQL. I’ve not played with the PM database much, but to select all records with a certain string in the body field of pm_comment you’d use:

SELECT * FROM pm_comment where MATCH(body) AGAINST(‘some string’);

NOTE: you will need to add a fulltext index to the body column of pm_comment. By default, this only works on strings 4 chars or more. And MySQL will treat any query where the result set is more than half of the total record count as if it returned an empty set. Read http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html for more information on fulltext search in MySQL.

Also, since there are 2 foreign keys in pm_comment, deleting records will nilly might screw things up

Profile
 
 
Posted: 09 December 2004 09:20 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  9
Joined  2003-07-19

I’ve been deleting spam by using a sql query in my phpMyAdmin. Now this doesn’t prevent the spam, but it certainly helps to delete it quickly. I’ve posted this on another thread.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 62654 Total Logged-in Users: 0
Total Topics: 77190 Total Anonymous Users: 0
Total Replies: 416697 Total Guests: 15
Total Posts: 493887    
Members ( View Memberlist )
Active Members: