Help! with "fatal error"

Permalink 1 user found helpful
HI, our web site just displayed this error today. I have touched the site. Any help would be much appreciated!!

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1062: Duplicate entry '236313' for key 'PRIMARY'] in EXECUTE("insert into PageStatistics (cID, uID, date) values ('5', 0, NOW())") ' in /home5/uucglorg/public_html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /home5/uucglorg/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(1037): adodb_throw('mysql', 'EXECUTE', 1062, 'Duplicate entry...', 'insert into Pag...', false, Object(ADODB_mysql)) #1 /home5/uucglorg/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(993): ADOConnection->_Execute('insert into Pag...') #2 /home5/uucglorg/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(761): ADOConnection->Execute('insert into Pag...', Array) #3 [internal function]: ADOConnection->Query('insert into Pag...', Array) #4 /home5/uucglorg/public_html/concrete/libraries/database.php(73): call_user_func_array(Array, Array) #5 /home5/uucglorg/public_html/concrete/models/user.php(177): Database->__call( in /home5/uucglorg/public_html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78

 
mkly replied on at Permalink Reply
mkly
Hello,
You can either go into the database and delete the PageStatistics record with a pstID of 236313 or create a tools file

/tools/fixstats.php

<?php
Loader::db()->Execute('DELETE FROM PageStatistics WHERE pstID=236313;');
echo 'db record deleted';


And then browse on your site to
http://www.example.org/index.php/tools/fixstats


Then delete that file.

Depending on your concrete5 version you will likely need to disable you Overrides Cache before browsing to the tools location(you can turn it back on once you are done).

BACKUP YOUR DATABASE BEFORE DOING THIS. BACKUP YOUR DATABASE FIRST!!!

Best Wishes,
Mike
webperson replied on at Permalink Reply
Hi Mike,
Thank you very much for your reply. However, I am just a volunteer for my church's web site. I'm not sure what you mean by accessing the "database"- where would that be? Right now I can't enter the site at all.

thanks,
exchangecore replied on at Permalink Reply
exchangecore
If you only have Concrete5 login the only thing that might help get rid of this error is to disable page statistics in the dashboard. You really need to have whoever has access to the file system or the database make the fix suggested to you.