title: foreach mysql row from query echo out html with row values
body: <p>So basicly what I'm trying to accomplish is that foreach row in mysql query it prints out the html with the data from that row. Here's what I have, it keeps giving me an error on my foreach.</p>
  
  <pre><code>&lt;?php
  
  $shots = mysql_query("SELECT * FROM shots") or die(mysql_error());
  
  while($row=mysql_fetch_array($shots))
  $data[]=$row;
  
  
  foreach($shots as $data)
  
    if (!empty($data)){
  
    $id = $data["id"];
    $shotby = $data["shot"];
    $passby = $data["pass"];
    $time = $data["time"];
  ?&gt;
  
  
  &lt;div class="feedbody"&gt;
  
      &lt;div class="title"&gt;&lt;?php echo $shotby; ?&gt;&lt;/div&gt;
      &lt;div class="feed-data"&gt;: gets a pass from &lt;span&gt;&lt;?php echo $passby; ?&lt;/span&gt; and he takes a shot!&lt;/div&gt;
      &lt;img class="dot" src="images/dot.png" /&gt;
  
  &lt;/div&gt;
  &lt;?php
  }
  
  }
  ?&gt;
  </code></pre>
  
  <p>Or something like that. Can anybody help point me in the right direction. I've been trying to find the answer.</p>
  
  <p><strong>EDIT:</strong> adding the error as requested.</p>
  
  <pre><code>Warning: Invalid argument supplied for foreach() in /home/content/93/7527593/html/fusionboard/includes/feed.php on line 7
  </code></pre>