Forums

Popularity Contest mysql error on post (1.2beta, WP 2.0.2) (8 posts)

  1. sgranade
    Member
    Posted 6 years ago #

    When I post a new topic, I get the following error reported:

    Warning: Invalid argument supplied for foreach() in /home/granades/public_html/wp-content/plugins/popularity-contest.php on line 1298
    You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3

    I'm running WP 2.0.2 and Popularity Contest v1.2beta from wp-plugins.org.

  2. MichaelH
    Volunteer
    Posted 6 years ago #

    Do you see the Admin->Options->Popularity panel okay? And in the Dashboard do you see the Most Popular Posts panel okay?

  3. sgranade
    Member
    Posted 6 years ago #

    Yeah, all of those show up fine. And posts still show up despite MySQL complaining like that. I moved to 1.2beta because similar problems were showing up in 1.0 and 1.1 for my install.

  4. MichaelH
    Volunteer
    Posted 6 years ago #

    I am having no issues when I install the beta on a 2.0.2 system.

    You do see xxx_ak_poplularity and xxx_ak_popularity_options tables in phpMyAdmin? (xxx_ = your database prefix)

  5. MichaelH
    Volunteer
    Posted 6 years ago #

    Here's the structure of the two tables I have:
    DESCRIBE wp_ak_popularity
    post_id int(11)
    total int(11)
    feed_views int(11)
    home_views int(11)
    archive_views int(11)
    category_views int(11)
    single_views int(11)
    comments int(11)
    pingbacks int(11)
    trackbacks int(11)
    last_modified datetime

    DESCRIBE wp_ak_popularity_options
    option_name varchar(50)
    option_value varchar(50)

  6. sgranade
    Member
    Posted 6 years ago #

    Both tables are in mysql, and their definitions match yours above.

  7. MichaelH
    Volunteer
    Posted 6 years ago #

    I'm not seeing the problem, so does this happen after you publish a post and view your site? If so, what 'popularity template tags' are you using and in what templates files do you have those tags?

    The error you are getting is likely due to the fact there are no posts in an array of posts--so what is causing the array to be empty? Like trying to display most popular posts in a category where their are no posts for that particular category...

  8. chottomatte
    Member
    Posted 6 years ago #

    I'm getting this error too, and did some checks to realise that while getting $posts globally the $posts returned is not an array so I implemented a check for $posts if it is an array. Not sure if that breaks the plugin and if I'm making sense since I don't really know php.

Topic Closed

This topic has been closed to new replies.

About this Topic