I am working on a custom query to show a few posts. I am able to output all the post ID's. I am trying to turn these ID's into an array so I can use 'post__in' => $myarray in my query. How can I do this?
<?php
$allposts = $wpdb->get_results("SELECT `music_id` FROM `custom_table` ORDER BY id DESC LIMIT 5");
foreach ($allposts as $singlepost) {
echo '<p>' .$singlepost->music_id. '</p>';
}
?>