Unable to use $wpdb
-
I am trying the code below, and I just cannot get it to work with the wordpress tables or my customer tables.
— My code —
[insert_php]
global $wpdb;
$wpdb->show_errors();$user_count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->users” );
$wpdb->print_error();
echo “Test”;
[/insert_php]— The Error Message/Output —
WordPress database error: []
SELECT COUNT(*) FROM wp_usersTest
Can it be my DB which is corrupt, is it my theme maybe, or something else ?
I am a bit lost and not sure how to troubleshoot this.
Thanks for any advice
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Unable to use $wpdb’ is closed to new replies.