WordPress.org

Ready to get started?Download WordPress

Forums

simple tagging - database problem (4 posts)

  1. davors
    Member
    Posted 7 years ago #

    I'm new to wordpress and I installed WP 2.2. Pluggin Simple Tagging does not work and it outputs in the sidebar:

    WordPress database error: [Not unique table/alias: 'stptags']
    SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts LEFT JOIN wp_stp_tags AS stptags ON (wp_posts.ID = stptags.post_id) LEFT JOIN wp_stp_tags AS stptags ON (wp_posts.ID = stptags.post_id) WHERE 1=1 AND (post_type = 'post' AND (post_status IN('static', 'publish') OR post_status = 'private')) AND stptags.tag_name IN ('software') AND stptags.tag_name IN ('software') GROUP BY wp_posts.ID HAVING COUNT(ID) = 1 ORDER BY post_date DESC LIMIT 0, 5

    and so on...

    Does anyone have a clue on how to fix this.

  2. davidbibo
    Member
    Posted 7 years ago #

    Greetings,

    Using WP 2.2.

    I have also posted this support question on the simpletagging support site.

    Whenever users click on tags at the bottom of our posts, they're successfully taken to a page with all of the posts for that tag but in the sidebar appears an error:

    'WordPress database error: [Not unique table/alias: 'stptags'] SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts LEFT JOIN wp_stp_tags AS stptags ON (wp_posts.ID = stptags.post_id) LEFT JOIN wp_stp_tags AS stptags ON (wp_posts.ID = stptags.post_id) WHERE 1=1 AND (post_type IN('page', 'post') AND (post_status IN('static', 'publish') OR post_status = 'private')) AND stptags.tag_name IN ('Giuliani') AND stptags.tag_name IN ('Giuliani') GROUP BY wp_posts.ID HAVING COUNT(ID) = 1 ORDER BY post_date DESC LIMIT 0, 10'

    Example: http://roguelystated.com/tag/Giuliani

    Thanks for any help you can provide,
    David

    davidbibo@roguelystated.com

  3. davidbibo
    Member
    Posted 7 years ago #

    Please note the fix referenced here worked for me. Good luck to others struggling with this.

    In case you have trouble with the embedded scrolling window on that page, here's the fix:

    Line 675:
    $join .= " LEFT JOIN {$this->info['stptable']} AS stptags ON ({$wpdb->posts}.ID = stptags.post_id) ";

    change by adding the following line, preceding the $join line:
    if(!ereg('stptags',$join))

    so you end up with:
    if(!ereg('stptags',$join))
    $join .= " LEFT JOIN {$this->info['stptable']} AS stptags ON ({$wpdb->posts}.ID = stptags.post_id) ";

    Cheers,
    davidbibo@roguelystated.com

  4. gspark
    Member
    Posted 7 years ago #

    upon deactivating the plugin, it doesn't delete the items it creates in the database and when i deleted those items then tried to activate it again it results in an error,

    wish these plugins would clean up after themsevels when deactivating :))

Topic Closed

This topic has been closed to new replies.

About this Topic