WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Select Query Error Message (2 posts)

  1. ninjaboy81
    Member
    Posted 6 years ago #

    $querystr = "
    SELECT wposts.*
    `FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
    `WHERE wposts.ID = wpostmeta.post_id
    `AND wpostmeta.meta_key = 'tag'
    `AND wpostmeta.meta_value = 'email'
    `AND wposts.post_status = 'publish'
    `AND wposts.post_type = 'post'
    `AND wposts.post_date < NOW()
    ` ORDER BY wposts.post_date DESC
    `";

    `$pageposts = $wpdb->get_results($querystr, OBJECT);

    the part in bold produces error:

    "Fatal error: Call to a member function get_results() on a non-object in filepath.php : eval()'d code on line 11"

    anyone know why?

  2. ninjaboy81
    Member
    Posted 6 years ago #

    Nevermind.. This Plugin Solves Everything SUPER EASILY:

    http://www.coffee2code.com/archives/2004/06/30/plugin-get-custom/

Topic Closed

This topic has been closed to new replies.

About this Topic