How do I loop through and output all the values in the array? The code I have stops after the first output.
$select_top = array($wpdb->get_results($wpdb->prepare( "SELECT * FROM `wp_top_voted` WHERE `todays_date`= CURDATE() ORDER BY `number_votes` DESC LIMIT 10", OBJECT )));
if ($select_top){
$i = 1;
foreach($select_top as $select_top_one){
$select_top_one->post_id;
$post_id_top[$i] = $select_top_one[$i]->post_id;
$number_votes[$i] = $select_top_one[$i]->number_votes;
$size = array(380,220);
?>
<div class="top-layout">
<div class="top-layout-row">
<div class="top-layout-cell">
<?php //remove background color. Make box look like widget.
?>
<div class="top-layout-cell">
<h4 class="top-video-title">
<a href="<?php the_permalink(); ?>">
<?php echo get_the_title( $post_id_top[$i] ); ?>
</a>
</h4>
<a href="<?php the_permalink(); ?>">
<?php echo get_the_post_thumbnail( $post_id_top[$i], $size ); ?>
</a>
<?php $i++; echo $i++; ?>
</div>
</div>