[Solved]: Maybe possibility to recover deleted hits-counter!? [Solved]: Maybe possibility to recover deleted hits-counter!?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Solved]: Maybe possibility to recover deleted hits-counter!?

Started by bmn, September 04, 2009, 06:24:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bmn

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?



Nibbler

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.

bmn

Quote from: Nibbler on September 04, 2009, 06:30:12 PM
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  ;)

bmn