Forums

Trouble with sql query (2 posts)

  1. blackfrog
    Member
    Posted 1 year ago #

    Im sure that this is probably an easy problem, but I am at a loss. I have a call:

    $result = $wpdb->insert( 'wp_post_accept', $dbfields);

    which inserts all of the rows just fine into the table, but when I try to get something out of the table, say:

    $check = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->post_accept"));

    or

    $check = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->wp_post_accept"));

    I get nothing returned. I don't know why this doesn't work, because all of my other calls to tables that I didn't create work just fine. Any help is appreciated

  2. vtxyzzy
    Member
    Posted 1 year ago #

    I think that $wpdb->post_accept and $wpdb->wp_post_accept are both empty. Try using just wp_post_accept without the $wpdb->.

Topic Closed

This topic has been closed to new replies.

About this Topic