mySQL unexpected error all of a sudden

Permalink
My database is pricechecker_db. Concrete's is concrete_pricechecker.

mysql error: [1146: Table 'pricechecker_db.Config' doesn't exist] in EXECUTE("select cfValue from Config where cfKey = 'SITE_TRACKING_CODE'")

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1146: Table 'pricechecker_db.Logs' doesn't exist] in EXECUTE("insert into Logs (logType, logText, logIsInternal) values ('exceptions', 'Exception Occurred: mysql error: [1146: Table \'pricechecker_db.Config\' doesn\'t exist] in EXECUTE("select cfValue from Config where cfKey = \'SITE_TRACKING_CODE\'")\n\n#0 /home/jborn/pricechecker.danandjenborn.com/concrete/libraries/3rdparty/adodb/adodb.inc.php(1037): adodb_throw(\'mysql\', \'EXECUTE\', 1146, \'Table \'priceche...\', \'select cfValue ...\', false, Object(ADODB_mysql))\n#1 /home/jborn/pricechecker.danandjenborn.com/concrete/libraries/3rdparty/adodb/adodb.inc.php(993): ADOConnection->_Execute(\'select cfValue ...\')\n#2 /home/jborn/pricechecker.danandjenborn.com/concrete/libraries/3rdparty/adodb/adodb.inc.php(1605): ADOConnection->Execute(\'select cfValue ...\', Array)\n#3 /home/jborn/pricechecker.danandjenborn.com/concrete/libraries/database.php(73): ADOConnection->GetRow(\'s in /home/jborn/pricechecker.danandjenborn.com/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78

 
jenborn replied on at Permalink Reply
It shouldn't be looking in my database for concrete tables. I have no idea. . .
jordanlev replied on at Permalink Reply
jordanlev
It definitely shouldn't be looking at another database. Double-check your config/site.php file to make sure it's pointing to the right one. Also, did you recently add any custom code that might have accidentally called a different database (this would be a block you created or a single_page or custom dashboard interface)?
jenborn replied on at Permalink Reply
Thanks for replying! I checked site.php and it's pointing to concrete's database as it should be. I'm using external forms and I do point to a different database for that, however, I started getting these errors suddenly and after my functionality was working well. It appears that my functionality is STILL working properly, but I'm getting these errors near the bottom of the page, so I'm bumfuzzled.

Feel free to experience the madness for yourself:
http://pricechecker.danandjenborn.com...

Thanks!
Jen
jordanlev replied on at Permalink Reply
jordanlev
After you switch the database to an external one, you need to reset the connection back to C5's default with this code:
$db = Loader::db(null, null, null, null, true);

(put this at the END of all your custom code, probably at the bottom of your external form's controller function).

Totally confusing and unintuitive, I know... that's just the way it is for now.
jenborn replied on at Permalink Reply
Wackadoo. So I removed the block that I was working on when the error tsunami hit because I decided I wanted slightly different functionality there anyway and although the error was popping up on completely different pages, now it's completely vanished.
jessicas158 replied on at Permalink Reply
The error that you encountered i.e. -
"mysql error: [1146: Table 'pricechecker_db.Config' doesn't exist] in EXECUTE("select cfValue from Config where cfKey = 'SITE_TRACKING_CODE'")"

or other similar errors like -

"ERROR 1146 (42S02): Table 'Table_name' doesn't exist."

generally occurs because of corrupt database. To resolve this issue you can run Quick Repair or rebuild the database and access the MySQL data. But in case the issue persists then to recover them using commercial MySQL Repair software is the best way out...

http://www.mysqlrepair.org
jordanlev replied on at Permalink Reply
jordanlev
For future reference: I think the above comment is spam. The claim that database errors are due to corrupt databases is almost never true (I suppose it could happen in very rare circumstances, but more often than not it's something else).
nickodalton replied on at Permalink Reply
nickodalton
I've got the same issue with a fatal error when transferring a concrete5 site to another server:
running the query manually via myadmin shows that the query works when the table is 'config' and not 'Config'.

Why is it looking for 'Config', how has this changed...?
jordanlev replied on at Permalink Reply
jordanlev
Usually this is caused by switching from Windows to Unix (because MySQL on windows is by default not case-sensitive so everything gets changed to lowercase, or something like that). See:
https://github.com/ahukkanen/c5_db_case_sensitivity...
http://www.concrete5.org/community/forums/installation/table-names-...
http://www.concrete5.org/community/forums/installation/uncaught_exc...
http://www.concrete5.org/community/forums/installation/move_from_xa...
nickodalton replied on at Permalink Reply
nickodalton
great, thanks - just found those!
Nicko