I can run the following query on ‘wp_links’ tables or any other built-in tables in WordPress/MySQL database.
$comment_count = $wpdb->get_var($wpdb->prepare(“SELECT COUNT(*) FROM $wpdb->links;”));
echo “<p>Total comments: ” . $comment_count . “</p>”;
PROBLEM is that after I added new table, say ‘wp_newtable’, and I tried to run the same query on ‘wp_newtable’, nothing is shown although I have put some records in wp_newtable.
Did i miss something? Do I need to update some setting??
Appreciate your help!
- The topic ‘Cannot Run Query on Newly-Created Table in WordPress’ is closed to new replies.