• before anyone comes back with a “Why are you doing X anyway?
    just assume for the sake of arguement that i have a real reason, but i don’t want to add 3-4 paragraphs to explain it.
    my table name is wp_wuwc_users i have tried wuwc_users

    $usrcnt = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->wp_wuwc_users"));
    $user_count = $wpdb->get_results( "SELECT count(*) as cnt FROM wp_wuwc_users" );
    echo $usrcnt;  // does not return any data or anything else?
    print_r ($user_count[0]->cnt); // this works fine;

    is there a reason the former will not work? I am using an register_activation_hook to build the tables in the wp database.

The topic ‘plugin development issue’ is closed to new replies.