Posted on: 03/17/06 08:35pm
By: eyecravedvd
I have multiple external page wrapped in GL by echo-ing the header, start_block, end_block, and footer.
I'm experiencing an issue with just one of them. First let me explain that I have two different DBs, one for GL, and the other for the DVD DB. Now the page I'm having trouble with is my
DVD Review/Easter Egg[*1] page.
The footer.thtml will not be called. I moved the closing code
echo COM_endBlock();
echo COM_siteFooter(false);
into a different file, where it could closed as well, and I got an SQL error. When I pulled it up it had this:
Fri 17 Mar 2006 19:20:55 EST - 1146: Table 'dvddbname.gl_vars' doesn't exist. SQL in question: UPDATE gl_vars SET value = value + 1 WHERE name = 'totalhits'
Which for some reason is calling my DVD DB and not GL, but only on this page. So, when I finally figured out where this was being called from I commented out this line of code
// DB_change( $_TABLES['vars'], 'value', 'value + 1', 'name', 'totalhits', '', true );
Bam. The footer.thtml loaded just fine. I can't find any line of code that has a similiar function as GL, and it works on other DB driven pages without that error. What will happen if I disable that line of code, or can someone help me figure out why it's looking at the wrong DB?
oh BTW - I do call lib-common.php in the /dvd/index.php
gl_vars
Posted on: 03/19/06 09:12pm
By: eyecravedvd
What is gl_vars for. If I turn it off will it break anything?
gl_vars
Posted on: 03/20/06 02:07pm
By: Dirk
gl_vars is a general purpose table to store (name, value) pairs. The number of total hits on your Geeklog site is stored there, the last time the daily digest was sent, etc. Some plugins also use it store information there.
bye, Dirk
Re: gl_vars
Posted on: 12/05/08 08:46am
By: n4th4n
I just upgraded an old 1.3.9 install to 1.5 and I have a lot of custom code in it. I get the following error on static PHP pages that have a call to a database other than the geeklog db:
Text Formatted Code
An SQL error has occurred. Please see error.log for details.
Text Formatted Code
Table '(my other db).gl_vars' doesn't exist. SQL in question: UPDATE gl_vars SET value = value + 1 WHERE name = 'totalhits'
What's the best way to handle this? Should I add a gl_vars table to that db or is there an easy way to disable updating page hits for a certain page so the error doesn't occur?
Nate
[update: I copied gl_vars, gl_blocks, gl_staticpage to the other database and my custom code is working fine. Seems like a better solution would be to pop up a warning on the page that hits are not being registered for the page and the reason why, but no big deal]
Re: gl_vars
Posted on: 12/05/08 02:39pm
By: Dirk
Quote by: n4th4nI get the following error on static PHP pages that have a call to a database other than the geeklog db
Sounds messy. Make sure that the db connection used in the static page is separate from the one Geeklog uses. Which means that you should not use Geeklog's DB_xxx functions for that connection.
bye, Dirk