Welcome to Geeklog, Anonymous Monday, December 30 2024 @ 12:23 pm EST

Geeklog Forums

Visitor Stats - cleaning out old data?


Status: offline

rv8

Forum User
Regular Poster
Registered: 10/10/02
Posts: 105
Location:Ottawa, Canada
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
 Quote

Status: offline

DTrumbower

Forum User
Moderator
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
 Quote

Status: offline

rv8

Forum User
Regular Poster
Registered: 10/10/02
Posts: 105
Location:Ottawa, Canada
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
 Quote

All times are EST. The time is now 12:23 pm.

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