title: jquery toggle one div in php while loop
body: <p>I have this While loop in my php code where I echo rows inside one div that acts like a button and when I press that "button" I want to hide/show the connected div with the jQuery function "toggle". I only get it to work so that when I click any of the "buttons" it opens all divs and not just that one that's connected.</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
    $(".scorec").click(function(){
      $(".scorematcho").slideToggle('slow');
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>That's the jQuery I'm using at the moment.</p>
  
  <pre><code>&lt;?php $RM = mysql_query("SELECT * FROM score ORDER BY ScoreID DESC LIMIT 3");
  while ($ScoreD = mysql_fetch_assoc($RM)) { 
  $a = $ScoreD["ScoreOne"]; $b = $ScoreD["ScoreTwo"];?&gt;
  &lt;div class="scorec" &gt;
      &lt;?php if($a&gt;$b){;?&gt;&lt;font color="green"&gt;&lt;?php }else{?&gt;&lt;font color="red"&gt;&lt;?php }?&gt;
      &lt;div class="scorel"&gt;&lt;img src="flags/&lt;?php echo $ScoreD["FlagOne"]; ?&gt;.png" style="float:left;"&gt;
      &lt;?php echo $ScoreD["TeamOne"]; ?&gt; | &lt;?php echo $ScoreD["ScoreOne"]; ?&gt;&lt;/div&gt;
      &lt;div class="scorem"&gt;-&lt;/div&gt;
      &lt;div class="scorer"&gt;&lt;?php echo $ScoreD["ScoreTwo"]; ?&gt; | &lt;?php echo $ScoreD["TeamTwo"]; ?&gt;
      &lt;img src="flags/&lt;?php echo $ScoreD["FlagTwo"]; ?&gt;.png" style="float:right;"&gt;&lt;/div&gt;&lt;/font&gt;
  &lt;/div&gt;
  &lt;div class="scorematcho" &gt;
      &lt;div class="scorematch"&gt;
      de_dust2 
      16-2
      &lt;/div&gt;
      &lt;div class="scorematch"&gt;
      de_nuke 
      16-2
      &lt;/div&gt;
      &lt;div class="scorematch"&gt;
      de_dust 
      16-2
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;?PHP } session_destroy()?&gt;
  </code></pre>
  
  <p>That's the HTML/PHP I'm using. The div "scorec" is the "button" and "scorematcho" is the div I wan't to toggle.The text inside "scorematcho" shall be PHP also, just haven't changed it yet. I have searched and tested some things but can't get anything to work properly, I have noticed that some put all their PHP code inside an "echo", why is that and could that be the problem? Hope that's enough information, please tell if not. Also, if you have some other improvements you think I should make to the code, please tell. </p>