WordPress.org

Ready to get started?Download WordPress

Forums

Participants Database
[resolved] Undefined property: wpdb::$wp_participants_database (3 posts)

  1. e_kingstone
    Member
    Posted 10 months ago #

    Hi guys,

    I've been struggling with this issues for weeks and i can't see to find a fix for it...

    What i plan to do is to get an array out of a participants database column, in this case it's named name1 by connecting to participants_database table.

    I know my code works with regular core wordpress tables such as posts and comments but not with participants_database table.

    Here is my code ($i is an increment value to get the array value based on position):

    $name1 = $wpdb->get_col("SELECT name1 FROM $wpdb->participants_database");
    echo "$name1[$i]";

    And here is the error i face:

    Notice: Undefined property: wpdb::$wp_participants_database in /mnt/target06/851725/mysite.com/web/content/wp-includes/wp-db.php on line 566
    WordPress database error: [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 1]
    SELECT style FROM
    
    Notice: Undefined offset: 0 in /mnt/target06/851725/mysite.com/web/content/wp-content/plugins/participants-database/templates/pdb-list-detailed-labels.php on line 137
    
    Notice: Undefined property: wpdb::$wp_participants_database in /mnt/target06/851725/mysite.com/web/content/wp-includes/wp-db.php on line 566
    WordPress database error: [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 1]
    SELECT style FROM
    
    Notice: Undefined offset: 1 in /mnt/target06/851725/mysite.com/web/content/wp-content/plugins/participants-database/templates/pdb-list-detailed-labels.php on line 137

    http://wordpress.org/plugins/participants-database/

  2. xnau
    Member
    Plugin Author

    Posted 10 months ago #

    Should be

    $name1 = $wpdb->get_col("SELECT name1 FROM {$wpdb->prefix}participants_database");
    echo "$name1[$i]";
  3. e_kingstone
    Member
    Posted 10 months ago #

    Thank you so much, it finally works! :D

Reply

You must log in to post.

About this Plugin

About this Topic