Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How can I Fetch posts that are stored in the different table than the default table (wp_posts)?
Try below code
$result = $wpdb->get_results($wpdb->prepare("SELECT * FROM TABLE_NAME));
Replace TABLE_NAME with your custom table name.
Required, but never shown