When WordPress Default table, Echo Success. When Plugin Table, Echo Blank

Question

When I used this code, the result/echo display as I wanted.

<?php
$user_checks = $wpdb->get_results( 
    "
    SELECT ID, user_nicename
    FROM $wpdb->users
    "
);

foreach ( $user_checks as $user_check ) 
{
    echo $user_check->ID;
    echo $user_check->user_nicename;
}
?>

But when I choose table other then what wordpress provide e.g:

<?php
    $user_checks = $wpdb->get_results( 
        "
        SELECT id, name
        FROM $wpdb->uap_banners
        "
    );

    foreach ( $user_checks as $user_check ) 
    {
    echo $user_check->id;   
    echo $user_check->name;
    }
    ?>

The Result is blank… Did I miss something? (I’m new on wordpress)

0
, Muhaza 3 years 2020-07-07T01:10:22-05:00 0 Answers 67 views 0

Leave an answer

Browse
Browse