Hi i am trying to add a for each inside a while loop this is how I want to work the while loop retrieve the above from the database
PHP Code:
<li><a href="#tabs-<?php echo get_the_ID(); ?>" onclick="jwplayer('mediaplayer_vid_1').stop();jwplayer('mediaplayer_vid_2').stop();jwplayer('mediaplayer_vid_3').stop();jwplayer('mediaplayer_vid_4').stop();"><?php  echo get_the_post_thumbnail$post_id'story-thumbnail'); ?></a></li>
so it display the above various time

But I am trying to achive the above plus a the foreach inside the onclick because i want to for each post to increment the number inside the onclick mediaplayer_vid_1, mediaplayer_vid_2, mediaplayer_vid_3

so i have the foreach loop that increment by 1
PHP Code:
<?php foreach ($posts as $post$post_count++; ?>
                  <?php echo "jwplayer('mediaplayer_vid_3').stop()"$post_count?>
I want that to be inside the onclick
I have tried like this but does not work anyone can help me out
PHP Code:
<li><a href="#tabs-<?php echo get_the_ID(); ?>" onclick="<?php foreach ($posts as $post$post_count++;  echo "jwplayer('mediaplayer_vid_ '.$post_count.').stop()"?>><?php  echo get_the_post_thumbnail$post_id'story-thumbnail'); ?></a></li>
Thanks in advance