Support » Plugins » [Plugin: Popularity Contest] Unable to activate in WordPress 3.0.2

  • Resolved microsleep



    I am running the latest version of WordPress (3.0.2) on a local server. I want to try/use Popularity Contest plugin, but each time I attempt to active it, I have an error message which says:

    Plugin could not be activated because it triggered a fatal error.
    Incorrect table name '' on line: 255

    Here is the function written in these lines:

    $result = mysql_query("
    			CREATE TABLE <code>$wpdb->ak_popularity_options</code> (
    				<code>option_name</code> VARCHAR( 50 ) NOT NULL,
    				<code>option_value</code> VARCHAR( 50 ) NOT NULL
    		", $wpdb->dbh) or die(mysql_error().' on line: '.__LINE__);
    		if (!$result) {
    			return false;

    I can also tell you that my MySQL settings look like this:

    /** The name of the database for WordPress */
    define('DB_NAME', 'wordpress');

    Your help will be much appreciated — do you have any ideas?

Viewing 15 replies - 1 through 15 (of 33 total)
  • OK — finally, I have found a solution by myself! 😉

    All you have to do is to get connected to your phpMyAdmin panel and create a new table called ak_popularity containing 2 fields within your WordPress database, et voilà.

    Thanks for the fix on this. It was driving me mad. I really liked this plugin and it was easy to incorporate in various ways and places on the blog.

    i created the table but still receive the same error. what values do i enter for the two fields? i’m not proficient with php/mysql at all but i really need to get this to work. any help is appreciated.



    Please can you let us know what the names of the tables and the names of the fields are?

    I know there are at least two tables:

    • ak_popularity
    • ak_popularity_options

    Thank you

    I am still having trouble getting this to work, can you provide the exact SQL command you used? would be very much appreciated!

    My next attempt will be to download the Popularity contest tables from another of my sites, import them in to my new site and drop the contents, seems like a whole lot of trouble for nothing though 🙁

    Here’s the two tables you need to create

    CREATE TABLE wp_ak_popularity (
    post_id int(11) NOT NULL,
    total int(11) NOT NULL,
    feed_views int(11) NOT NULL,
    home_views int(11) NOT NULL,
    archive_views int(11) NOT NULL,
    category_views int(11) NOT NULL,
    tag_views int(11) NOT NULL,
    single_views int(11) NOT NULL,
    searcher_views int(11) NOT NULL,
    comments int(11) NOT NULL,
    pingbacks int(11) NOT NULL,
    trackbacks int(11) NOT NULL,
    last_modified datetime NOT NULL,
    KEY post_id (post_id)

    — Dumping data for table wp_ak_popularity

    — Table structure for table wp_ak_popularity_options

    CREATE TABLE wp_ak_popularity_options (
    option_name varchar(50) NOT NULL,
    option_value varchar(50) NOT NULL

    I forgot to mention, during testing make sure you allow views from the author otherwise it will continue to read Popularity unranked

    @smartyds, thank you very much, Brother… You make my day light… I solved it using your solution…

    I tried entering the code listed above into the editor program for popularity plugin but after attempting to activate I now have an error on line 283?

    Any ideas on why this is happening?

    Are these tables duplicates to the already existing tables. Looking at the code for the existing tables looks identical to the ones listed above. I’m kind of a newbie here as I’m sure you can tell. Please help!

    Ok so I figured out how to access my phpmyadmin panel. I clicked on ‘databases’ then went down to the create new table section typed in ak_popularity for the name and for number of fields put in 2. Now I get two rows with ‘fields’, ‘type’, ‘length/values’, ‘coalition’, ‘attributes’, etc… for the column headers. This is where I am now lost. I don’t know what to enter into these boxes to create these tables which would allow the plugin to work.

    Please assist further

    Wow… so I hit the SQL query button and pasted the code you displayed above. The tables were created and I activated the plugin and it worked!!! Went from a newb to a rockstar LOL. Thanks for this man!

    Thank you so much sanglucci for giving those step by step instructions! You saved me SO much time 🙂

    Nice avignon glad it helped. I now ran into one more problem folks, the plugin works fine but now I can’t edit the popularity values in the settings portions. They automatically reset to the default values when I try changing them.

    Any thoughts here?

    R P


    Thanks buddy it worked for me too. Only think I would like to mention here is about the table prefix, “wp_” mentioned above needs to be replaced by yours in case you have different table prefix.

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘[Plugin: Popularity Contest] Unable to activate in WordPress 3.0.2’ is closed to new replies.