Hi im a newbie here. I have a script running on my site and i wanted to create a script that will automatically(using cron every hour) get rid of ads that have words which do not belong on the site either in the title or the description.
Here is what i come up with within the last 8 hours :-)
<?php
$query = "DELETE FROM `clf_ads` WHERE `adtitle`,`addesc` LIKE 'porn','warez','sex'";
$res = @mysql_query($query);
if($res)
{
echo 'Deleted '.mysql_affected_rows($res).;
}
else
{
echo 'Error: #'.mysql_errno().'<br>'.mysql_error();
}
?>
"adid" is the advertisment id, but i don't think i need that, not exactly sure.
Any help is greatly appriciated!