WordPress.org

Forums

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

  1. nhantidus
    Member
    Posted 2 years 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. Jamie
    Member
    Plugin Author

    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PHP Code for posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic