Auto Increment and match HTML
<p>I have the following PHP loop, and I put some jquery inside (not sure if that is proper syntax anyways), but I need to dynamically change the class so I can match the queried image in the HTML.  I wanted to add a class of thumbsCount, so it would result in img class="thumbsCount1, img class="thumbsCount2" etc. and then each img.thumbsCountx would have the proper placeholder.</p>

<pre><code>&lt;? while ($results = mysqli_fetch_array($profiles)) { ?&gt;
  &lt;div class="item"&gt;

  &lt;script type="text/javascript"&gt;
  $(function() {
    var videoID = '&lt;?= $results['video'] ?&gt;';

    var count = 1;
    $.getJSON(xxx) {    
       $(".thumbsCount" + (count++)).attr('src', data[0].thumbnail_medium);});

       $(".thumbs").addClass("thumbsCount" + (count++));
    });

  &lt;/script&gt;
    &lt;img class="thumbs" /&gt;
  &lt;/div&gt;
&lt;? } ?&gt;
</code></pre>
