These forums are not for official support. If you are looking for official support please click here.

Welcome guest, please Login or Register

You are here: Home :: Forum Home :: Modules :: Hits :: Thread

   

Database error on begining of 2012

Rank

Total Posts: 2

Joined 2010-12-25

PM

 

Dear DevDemon Team

first of all thanks for all the great add-ons ,

secondly , I tried to access my Cp on 2012 and instead the followig database error occured

Error Number: 1054

Unknown column ‘hs.d_0’ in ‘field list’

SELECT `ct`.`title`, `hs`.`entry_id`, hs.d_0 AS hits FROM (`exp_hits_stats` hs) LEFT JOIN `exp_channel_titles` ct ON `hs`.`entry_id` = `ct`.`entry_id` WHERE `hs`.`type` = 1 AND `hs`.`year` = ‘2012’ ORDER BY `hs`.`d_0` DESC LIMIT 10

Filename: third_party/hits/acc.hits.php

Line Number: 124

any help is much appreciated , thanks

Rank

Total Posts: 2

Joined 2011-05-05

PM

 

Hi,

I got the some error today and found a quick solution for that.
I don’t know if it is the best one, but it works at the moment.

I opened the acc.hits.php and replaced the following line with this code:

Original Code

// Which Ones?
  
switch ($type{
   
case 'today':
    
$this->EE->db->order_by("hs.d_{$day}"'DESC');
    
$this->EE->db->select("hs.d_{$day} AS hits"FALSE);
    break;
   case 
'week':
    
$this->EE->db->order_by("hs.w_{$week}"'DESC');
    
$this->EE->db->select("hs.w_{$week} AS hits");
    break;
   case 
'month':
    
$this->EE->db->order_by("hs.m_{$month}"'DESC');
    
$this->EE->db->select("hs.m_{$month} AS hits");
    break;
   case 
'year':
    
$this->EE->db->order_by('hs.total''DESC');
    
$this->EE->db->select("hs.total AS hits");
    break;
   default:
    
$this->EE->db->order_by("hs.d_{$day}"'DESC');
    
$this->EE->db->select("hs.d_{$day} AS hits"FALSE);
    break;
  

New Code

// Which Ones?
  
switch ($type{
   
case 'today':
    if (
$day == 0{
    $this
->EE->db->order_by("hs.d_{$day}0"'DESC');
    
$this->EE->db->select("hs.d_{$day}0 AS hits"FALSE);
    
else {
    $this
->EE->db->order_by("hs.d_{$day}"'DESC');
    
$this->EE->db->select("hs.d_{$day} AS hits"FALSE);
    
}
    
break;
   case 
'week':
    
$this->EE->db->order_by("hs.w_{$week}"'DESC');
    
$this->EE->db->select("hs.w_{$week} AS hits");
    break;
   case 
'month':
    
$this->EE->db->order_by("hs.m_{$month}"'DESC');
    
$this->EE->db->select("hs.m_{$month} AS hits");
    break;
   case 
'year':
    
$this->EE->db->order_by('hs.total''DESC');
    
$this->EE->db->select("hs.total AS hits");
    break;
   default:
    if (
$day == "0"{
    $this
->EE->db->order_by("hs.d_{$day}0"'DESC');
    
$this->EE->db->select("hs.d_{$day}0 AS hits"FALSE);
    
else {
    $this
->EE->db->order_by("hs.d_{$day}"'DESC');
    
$this->EE->db->select("hs.d_{$day} AS hits"FALSE);
    
}
    
break;
  

This Code adds the the second 0 for the databasefield (d_0 to d_00).
As i said it’s a quick fix and it can be done better.

I hope that helps.

Kind Reagrds
Wolfgang

Signature

——————————-
NIWO Software
Software Development and RS Classes

Rank

Total Posts: 2

Joined 2011-05-05

PM

 

I just wanna add, that this quick fix solves only the problem, that you can’t login in the CP.

But Hits itself doesn’t count at the moment.

Signature

——————————-
NIWO Software
Software Development and RS Classes

Rank

Total Posts: 5

Joined 2010-09-22

PM

 

Same error here. Was getting a emails about bloggers unable to post,
attempted at reinstalling Hits, still same issue. Ended up just removing it for now….

Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

Hi guys,

Sorry for this inconvenience, we fixed this issue immediately.
Please download Hits 2.3 from here or at devot-ee.com

Happy new year!

Rank
Rank
Rank
Rank

Total Posts: 2811

Joined 2010-12-24

PM

 

Hello,

Hits 2.3 has been released to deal with the problem with day 0 of the new year.

Brad

Rank

Total Posts: 10

Joined 2010-05-02

PM

 

Hi

I’ve just replied this update and all my hits are reset to 0 :(

When i visited the hits module page it did hang for a long time, and I pressed the back button.  I guess that might have broken the update process?
Are all my hits lost now?

Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

Joobs,

If you know how to do it:
Can you send me an dump of your sql table? (Just need exp_hits_stats)
Email me at .(JavaScript must be enabled to view this email address)

Rank

Total Posts: 10

Joined 2010-05-02

PM

 

hmm looking at the database there does seem to be hits information in there.

Maybe my understanding of it is wrong.

On the front end, if i view something by year, should it show the results for the last 365 days or would it show the results from the start of 2012 (eg 1 days worth)

Same in the CP.  at the top of an entry was expecting the year value to show results from the last 365 days, but it’s reading 0.  But looking at the database no one has viewed it yet in 2012.

Could you explain a bit what i should be expecting?

Rank

Total Posts: 15

Joined 2011-04-11

PM

 

I’m experiencing no Hits results on the front end of the my sites. Also no data on the Hits tab. I’ve upgraded to 2.3 of Hits. Any ideas?

UPDATE: Hits has restarted the counts. So things are starting to show on the front-end, but all previous Hits data is not used.

Rank

Total Posts: 12

Joined 2011-07-24

PM

 

Just chiming in here to subscribe to the thread and say I ran into this as well and am updating to 2.3.

Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

Hits 2.3 does indeed help with the database error, but the hits data is stored in a yearly table..
So all stats are *current* year based. It’s only an issue for the first days of the year since it’s counting from jan1.
We are reviewing options for a future release to remove this limitation (which also would increase database usage and impact performance a bit)

Rank

Total Posts: 15

Joined 2010-06-16

PM

 

I’m trying to download Hits 2.3 as I’m having the same problem as everyone else, but there is no option to download this item under my downloads. I can still see the record of the order from October, but It is making purchase the item again.

How can I download?

Jason

Rank

Total Posts: 15

Joined 2010-06-16

PM

 

I’m actually getting anew error now after updating the software. It’s not on the backend, but it’s on the front end whenever I click the “read more” button at the bottom of a post.

Error Number1054

Unknown column 
'site_id' in 'field list'

INSERT INTO `exp_hits_stats` (`site_id`, `entry_id`, `channel_id`, `item_id`, `type`, `year`, `total`, `m_01`, `w_01`, `d_02`) VALUES ('1''152''1'01'2012'1111)

Filenamethird_party/hits/models/hits_model.php

Line Number
76 

Any ideas on a fix for this?

Rank
Rank
Rank
Rank

Total Posts: 1237

Joined 2010-12-24

PM

 

Did you run module updates?

Rank

Total Posts: 1

Joined 2012-01-03

PM

 
jwmatlock - 01 January 2012 08:02 PM

I’m experiencing no Hits results on the front end of the my sites. Also no data on the Hits tab. I’ve upgraded to 2.3 of Hits. Any ideas?

UPDATE: Hits has restarted the counts. So things are starting to show on the front-end, but all previous Hits data is not used.

I’ve got a similar issue.

On the Hits tab it’s only counting hits on 1 channel, ignoring all the others.