PDA

View Full Version : Clear logs from admin panel


manfred
02-24-2004, 06:39 AM
Here is mod to clear logs from admin panel and also log status is displayed. This is done because logs were left even after the hole site was deleted! Try it and send a comment.

Installation: just unzip to your PhpDig folder and open admin panel.

Note that this is only for 1.8.0 version of PhpDig!

-m-

alivin70
02-25-2004, 05:18 AM
Hi,
thank you for your code.

Why you do this:
$query = "SELECT l_id FROM ".PHPDIG_DB_PREFIX."logs";
$id = mysql_query($query,$id_connect);
while (list($key_id) = mysql_fetch_row($id))
{
$query_delete = "DELETE FROM ".PHPDIG_DB_PREFIX."logs WHERE l_id=$key_id";
$id_del = mysql_query($query_delete,$id_connect);
$del++;
}
why not a simpler:
$query_delete = "DELETE FROM ".PHPDIG_DB_PREFIX."logs";
$id_del = mysql_query($query_delete,$id_connect);
$del = mysql_affected_rows($id_connect);
thanks
Alivin70

manfred
02-25-2004, 06:15 AM
I'm not very familiar with SQL syntax (yet) and if you compare that to clean_keywords.php there is a match!

Copy&paste is too easy solution - I know ;) but hey it works!

-m-