neden döngü daha sonra bir kez ... ben bir şey eksik yok

0 Cevap php

Tabloda tek bir kayıt i bir mektupla her ile 5 tablo var gibi neden o döngü yapar vardır

$query = "Select * from click_tracker";
$result = mysql_query($query);
$all_clicks = mysql_fetch_array($result);

foreach($all_clicks as $click){
    print "
    <table border=\"1\">
      <tr>
        <th>Location</th>
        <th>Visit Count</th>
      </tr>
      <tr>
        <td>{$click['url_destination']}</td>
        <td>{$click['count']}</td>
      </tr>
    </table>";
}

Burada tablo döndürülür

<table border="1">
  <tr>
    <th>Location</th>

    <th>Visit Count</th>
  </tr>
  <tr>
    <td>2</td>
    <td>2</td>
  </tr>
</table>

<table border="1">
  <tr>
    <th>Location</th>
    <th>Visit Count</th>
  </tr>
  <tr>
    <td>2</td>

    <td>2</td>
  </tr>
</table>
<table border="1">
  <tr>
    <th>Location</th>
    <th>Visit Count</th>

  </tr>
  <tr>
    <td>h</td>
    <td>h</td>
  </tr>
</table>
<table border="1">
  <tr>

    <th>Location</th>
    <th>Visit Count</th>
  </tr>
  <tr>
    <td>h</td>
    <td>h</td>
  </tr>

</table>
<table border="1">
  <tr>
    <th>Location</th>
    <th>Visit Count</th>
  </tr>
  <tr>
    <td>5</td>

    <td>5</td>
  </tr>
</table>
<table border="1">
  <tr>
    <th>Location</th>
    <th>Visit Count</th>

  </tr>
  <tr>
    <td>5</td>
    <td>5</td>
  </tr>
</table>   

0 Cevap