Interact with your WordPress Database
In WordPress, there is a global object called $wpdb which is used to interact with your WordPress database. $wpdb also stores the correct names for all the WordPress tables. To call the table names, you can use these variables: $wpdb->posts; // Returns the name of of the posts table.
$wpdb->postmeta; // Returns the name of the post meta table.
$wpdb->commentmeta; // Returns the name of