Ok in my site i get a loads of spam comments, you know.
so i want to write a script that searches the comments field and deletes any comment that contains specific words.
table is called mos_comment and field is comment
Here is what i have so far. im using the word "test" as an example of a comment that has this word and to delete that comment,
Code: Select all
<?php
$total= mysql_query("Select COUNT(*) from mos_akocomment");
?>
<?php
while ( $total<= 1 ) {
php mysql_query("DELETE FROM mos_akocomment WHERE comment = 'test'");
}
?>Im not surprised its not working, anyone help me out