WordPress.org

Ready to get started?Download WordPress

Forums

PHP Code for posts
[resolved] Error with $wpdb->get_results (2 posts)

  1. nhantidus
    Member
    Posted 7 months ago #

    Run good. But error with $wpdb->get_results
    Detail:
    Fatal error: Call to a member function get_results() on a non-object in E:\Data\...\wp-content\plugins\php-code-for-posts\PHPPostCode.php(58) : eval()'d code on line 11

    http://wordpress.org/plugins/php-code-for-posts/

  2. The.Missing.Code
    Member
    Plugin Author

    Posted 6 months ago #

    you will need to reference the global $wpdb before running your code.

    global $wpdb;
    $result = $wpdb->get_results($query)

    if you have not included the global reference, the $wpdb var will not be set to an instance of the db class.

Reply

You must log in to post.

About this Plugin

About this Topic