Hej Så er jeg her igen
I har tidligere hjulpet mig med og skifte farver i hver række..
Nu kommer spørgsmålet så.
Hvis jeg gerne vil ha den smider et nr på os.
Altså
1. blabla
2. Blalalal
3. llalala
Osv.
Hvordan kan det gøres ? har kigget forumet igennem og Google uden held
- <?php
- require("config.php");
-
- // Connect to server and select database.
- mysql_connect("$mysql_host", "$mysql_user", "$mysql_pw")or die("cannot connect");
- mysql_select_db("$mysql_db")or die("cannot select DB");
-
- // Retrieve data from database
- $x = 0;
- $sql="SELECT * FROM DM ORDER BY POKAL DESC";
- $result=mysql_query($sql);
-
- $sql2="SELECT * FROM DMadm WHERE id= 1";
- $result2 = mysql_query($sql2);
- $rows2 = mysql_fetch_array($result2)
-
- ?>
-
- <table border="0" width="480" style="border-collapse: collapse;">
- <tr>
- <td width="100%" style="border-bottom-style: none; border-bottom-width: medium;" colspan="2"><b><?php echo $rows2[Titel]?> - Rangliste</b></td>
- </tr>
- <tr>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;" height="10"></td>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;" height="10"></td>
- </tr>
- <tr>
- <td width="50%" style="border-bottom-style: solid; border-bottom-width: 1px;background-color: #C0C0C0" bordercolor="#000000"><b><font size="2">Clan:</font></b></td>
- <td width="50%" style="border-bottom-style: solid; border-bottom-width: 1px;background-color: #C0C0C0" bordercolor="#000000"><b><font size="2">Pokaler:</font></b></td>
- </tr>
- <tr>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;" height="10"></td>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;" height="10"></td>
- </tr>
-
- <?php
-
- // Start looping rows in mysql database.
-
- while($rows=mysql_fetch_array($result)){
-
- $x++;
-
- $color = $x%2 == 0 ? '#aaa' : '#eee';
-
- ?>
-
- <tr style="background-color:<?php echo $color; ?>">
- <td width="50%" style="border-top-style: solid; border-top-width: 1px"><font size="2"><?php echo $rows[Clan]?></font></td>
- <td width="50%" style="border-top-style: solid; border-top-width: 1px"><font size="2"><?php echo $rows[Pokal]?></td>
- </tr>
-
- <?
-
- // close while loop
-
- }
-
- // close connection
-
- mysql_close();
-
- ?>
- <tr>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;" height="10"></td>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;" height="10"></td>
- </tr>
- <tr>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;background-color: #C0C0C0; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px" bordercolor="#000000"><b><font size="2">
- <a href="regler.php" onClick="javascript:window.open('regler.php','Windows','width=450,height=500,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no');return false")"">Se reglerne her</a>
- </font></b></td>
- <td width="50%" style="border-bottom-style: none; border-bottom-width: medium;background-color: #C0C0C0; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px" bordercolor="#000000"><b><font size="2"><?php echo $rows2[Tilmed]?></font></b></td>
- </tr>
- </table>