forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: bmn on September 04, 2009, 06:24:39 pm
-
Hi there,
Maybe is it better to post here, then in the Dev corner.
Ok, it now happend to me. I deleted the hits-counter records. Shame on me, but that radio button tricked me out. I then changed the util.php. . . .
The reason why I post is, that there is maybe a possibility to recover the hits-counter. In the database there is a table called "hit_stats". For each PID which is equal to a picture in the gallery there is a line for each hit on a picture. Is there a way to count the hits for each PID in the "hit_stats" and then write the result or sum for each PID in the row "hits" in the "pictures" table? I donīt know how to do that.
Is there a way?
-
Run an SQL query like this in phpMyAdmin
UPDATE cpg_pictures AS p SET hits = (SELECT COUNT(*) FROM cpg_hit_stats AS s WHERE s.pid = p.pid)
change the table names as required.
-
Run an SQL query like this in phpMyAdmin
UPDATE cpg_pictures AS p SET hits = (SELECT COUNT(*) FROM cpg_hit_stats AS s WHERE s.pid = p.pid)
change the table names as required.
Thanks! I will try that.
At all with the same problem: donīt forget to backup your database first ;)
-
Hi!
Thanks to Nibbler! It worked!!
Greets