I have this sample code that I found online that's supposed to count the number of rows in a table. Of course... It works, but when I created my own table using phpMyAdmin... It no longer works. What am i doing wrong?
I'm also wondering whey the "wp_users" table name dosen't work, but "users" does..
My table name is "test" I've also tried "wp_test" but for some reason none of them work.
<?php
$user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users");
echo "<p>User count is {$user_count}</p>";
?>
FYI, I never use forums so forgive me if i'm not doing something right.
testyour query will be"SELECT COUNT(*) FROM test"$wpdbuse WordPress Codex. User Count functions : codex.wordpress.org/Function_Reference/count_users & codex.wordpress.org/Function_Reference/get_user_count