Home Forums WoodMart support forum I'm getting database errors

I'm getting database errors

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #102741

    mark-aaron
    Participant

    FRom my hosting company support:
    Reading the error from your logs, it looks like the problem is connected to the table “term_relationships” not being queried correctly. So the query which is written to get records from this database is running into an issue there. The query itself probably needs to be altered. I am unable to see where this query is originating from. What I can see in the logs is that different files seem to be included in the code:

    GROUP BY terms.term_id made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/plugins/woocommerce/templates/taxonomy-product_cat.php’), wc_get_template, include(‘/themes/woodmart/woocommer” while reading response header from upstream, client: 207.46.13.253, server: http://www.hushhush.com, request: “GET /aircraft/jets/boeing/727/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php7.2-fpm-hushhush.sock:”, host: “www.hushhush.com”

    #102789

    Artem Temos
    Keymaster

    Hi,

    What exactly query are you writing about? Could you please indicate this query in files? Which script calls this query?

    Kind Regards

    #102845

    mark-aaron
    Participant

    If we look at the error log below, the error happen in this page hushhush.com/brand/laura-gulshani/ . This page is delivered by certain page template in the theme, which I could not tell from the outside.

    2019/01/19 01:57:56 [error] 18811#18811: *380809 FastCGI sent in stderr: “PHP message: WordPress database error Not unique table/alias: ‘term_relationships’ for query SELECT COUNT( DISTINCT posts.ID ) as term_count, terms.term_id as term_count_id FROM posts
    GROUP BY terms.term_id made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/woodmart/woocommerce/archive-product.php’), do_action(‘woocommerce_sidebar’), WP_Hook->do” while reading response header from upstream, client: 178.154.200.26, server: http://www.hushhush.com, request: “GET /brand/laura-gulshani/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php7.2-fpm-hushhush.sock:”, host: “www.hushhush.com”
    AND terms.term_id IN (24,136,17837,17838,147,377,85)
    )
    term_relationships.term_taxonomy_id IN (1163)
    AND
    )
    WHERE term_taxonomy_id IN (8)
    FROM term_relationships
    SELECT object_id
    posts.ID NOT IN (
    AND (
    AND posts.post_status = ‘publish’
    WHERE posts.post_type IN ( ‘product’ )
    LEFT JOIN term_relationships ON (posts.ID = term_relationships.object_id)
    INNER JOIN terms AS terms USING( term_id )
    INNER JOIN term_taxonomy AS term_taxonomy USING( term_taxonomy_id )
    INNER JOIN term_relationships AS term_relationships ON posts.ID = term_relationships.object_id

    #102848

    Artem Temos
    Keymaster

    Are you talking about the same query you wrote in your another topic https://xtemos.com/forums/topic/database-query-problem-from-my-host-provider/ ?

    #102852

    mark-aaron
    Participant

    I think we are getting multiple database errors and bad queries, is there anyway you can access and see the errors and if you can help resolve them if they are related to the theme?

    #102855

    Artem Temos
    Keymaster

    Lets continue our conversation on that topic. Please, use the solution we sent you first.

    #102862

    mark-aaron
    Participant

    I have implimented the code you sent me, this quiery is from my hosting company who said there are however more errors.

    #102882

    Artem Temos
    Keymaster

    Please, send us a screenshot where you placed the code and be sure that the child theme is active in Appearance -> Themes.

Viewing 8 posts - 1 through 8 (of 8 total)