ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE query selecting wrong database

June 12, 2008 10:32pm

Subscribe [3]
  • #1 / Jun 12, 2008 10:32pm

    PixelFive

    17 posts

    Hey guys,

    Something rather interesting is happening and I can’t figure out the solution.

    I have 3 different databases on my server. The embed files inside my templates seem to be calling the right tables but in the wrong database. Here’s the error:

    MySQL ERROR:

    Error Number: 1146

    Description: Table ‘db36199_adserver.exp_template_groups’ doesn’t exist

    Query: SELECT exp_templates.template_name, exp_templates.template_id, exp_templates.template_data, exp_templates.template_type, exp_templates.edit_date, exp_templates.save_template_file, exp_templates.cache, exp_templates.refresh, exp_templates.no_auth_bounce, exp_templates.enable_http_auth, exp_templates.allow_php, exp_templates.php_parse_location, exp_templates.hits, exp_template_groups.group_name FROM exp_template_groups, exp_templates WHERE exp_template_groups.group_id = exp_templates.group_id AND exp_template_groups.site_id = ‘1’ AND exp_templates.template_name = ‘page_header’ AND exp_template_groups.group_name = ‘noozhawk’

    The query is calling the ‘db36199_adserver where it should be calling ‘db36199_nhawkee’.

    Any thoughts on this?

    Thanks

  • #2 / Jun 12, 2008 10:39pm

    Sue Crocker

    26054 posts

    How are you calling the query?

  • #3 / Jun 12, 2008 10:48pm

    PixelFive

    17 posts

    Hi,

    This is the code that doesn’t seem to render properly:

    {embed="noozhawk/page_header" cache="yes" page_title=" - Local News"}
    {embed="noozhawk/page_top"}

    I should note that it happens only every once in a while.

  • #4 / Jun 13, 2008 2:21am

    PixelFive

    17 posts

    Changing the database connection type to persistent seems to do the trick. Anyone know why?

  • #5 / Jun 13, 2008 5:42pm

    Ingmar

    29245 posts

    It’s interesting, and although you solved it for now, I’d like to give a heads-up to the tech crew. Thanks for bringing this up.

  • #6 / Jun 13, 2008 5:59pm

    PixelFive

    17 posts

    Thanks Ingmar,

    The symptom was interesting. The superadmins received the full SQL error page. Users received the page minus the all tag elements up to the middle to the page. Therefore, they saw a page that did not contain the doc type, head, html opening tags. In essence, they saw a page without the css. Again, the interesting caveat here is that it didn’t happen all the time AND if you refreshed the page, the error would go away.

  • #7 / Jun 13, 2008 6:07pm

    Ingmar

    29245 posts

    Yes, I couldn’t replicate it, either. Let’s see what, if anything, the devs have to say.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases