Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks


Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Wednesday, June 19 2013 @ 01:08 AM EDT


 Forum Index > Support > Plugin Support New Topic Post Reply
 Visitor Stats - cleaning out old data?
   
rv8
 09/01/03 01:22PM (Read 1091 times)  
++++-
Regular Poster

Status: offline


Registered: 10/10/02
Posts: 103
I\'m running the Visitor Status plugin, v1.2. It has proved useful a few times in helping me see exactly what a visitor did that triggered an error.log entry. I also like the historical record of visitors per day, and visitors per month.

But, the gl_visitors table contains every visitor click all the way back to when I installed the plugin. I don\'t need the old data, so I would like to delete a few thousand rows from the table.

I am a mysql newbie, so I am nervous about just jumping in and trying to craft sql statements to delete old data, as there is a very good chance I\'ll screw it up and have to waste a bunch of time figuring out how to restore that table from my backups. So, can anyone provide a hint as to the best (i.e. safe and easy) way to remove data that is more than 60 days old (or older than some specified date if that is easier to code) from the gl_visitors table? I can use mysql directly, or use phpMyAdmin (my preference).

I tried posting this question on the GPlugs forum, but they seem to be having problems today.

Thanks in advance.

Kevin Horton
 
Profile Email Website
 Quote
DTrumbower
 09/01/03 01:52PM  
MMMMM
Moderator

Status: offline


Registered: 01/08/03
Posts: 507
I don\'t have the table stuctures but this would be a genaral statement.

Delete from tablename
where columndate

 
Profile Email
 Quote
rv8
 09/01/03 02:23PM  
++++-
Regular Poster

Status: offline


Registered: 10/10/02
Posts: 103
Thanks DT, that was the hint I needed.

For the record, I used phpMyAdmin to run some SQL statements. First, I removed all the 2002 data with:

DELETE FROM `gl_visitors` WHERE year = \"2002\"

Then I removed each of the early months in 2003 by:

DELETE FROM `gl_visitors` WHERE month = \"January\"

I did a separate delete for each month I didn\'t want. The table is much smaller now, and my site still works OK. An attempt to check the stats times out at the moment, but that has happened in the past once in a while too, so I\'m keeping my fingers crossed that I haven\'t hosed something up.

Kevin Horton
 
Profile Email Website
 Quote
Content generated in: 0.28 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content