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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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