Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wstawienie lp do tabeli przy pobieranych danych
Dominator
post
Post #1





Grupa: Zarejestrowani
Postów: 565
Pomógł: 15
Dołączył: 11.10.2010

Ostrzeżenie: (20%)
X----


Witam,
pobieram sobie informacje z bazy danych:

  1. while($details = $stmt->fetch())
  2. {
  3. echo "<tr>
  4. <td class='text-center'>1</td>
  5. <td class='text-center'><img src='http://cravatar.eu/helmavatar/".$details["owner"]."/64.png' class='avatar' /> </td>
  6. <td class='text-center'><a href='gildiaInfo.php?guild=".$details["name"]."'>".$details["name"]."</a> </td>
  7. <td class='text-center'><a href='gildiaInfo.php?guild=".$details["name"]."'>".$details["tag"]."</a>
  8. </td>
  9. <td class='text-center'>".$details["points"]."</td>
  10. <td class='text-center'>".$details["owner"]."</td>
  11. <td class='text-center'>".$this->countGuildMembers($details["name"])."</td>
  12. </tr>";
  13. }


Mam 100 rekordów i wyświetla się to w taki sposób:

1. tekst1
1. tekst2
1. tekst3
1. tekst4
1. tekst5

itd...

jak zrobić coś takiego żeby się wyświetlało tak:

1. tekst1
2. tekst2
3. tekst3
4. tekst4

itd...

Próbowałem z wstawianiem for, ale jakoś nie wychodziło..
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 7.10.2025 - 08:11