• logo_cipsoft
    Nowe serwery zostały otwarte 27 Sie 2025:
    Escura (Retro Open PvP) Mystera (Retro Open PvP) us_logo Penumbra (Retro Open PvP)

PHP [KONKURS][MODERN]Ranking Snake Game

Status
Zamknięty.

Kuzirashi

ASP.NET MVC, JS-SPA, PHP, NODE
Dołączył
Lipiec 24, 2010
Posty
772
Liczba reakcji
155
Live demo:
Tworzycie nowy plik .php w /system/pages/
PHP:
<?php
	$ots = POT::getInstance();
	$ots->connect(POT::DB_MYSQL, connection());
	$SQL = $ots->getDBHandle();
	$ranking = $SQL->query('SELECT * FROM `snake_highscore` ORDER BY `score` DESC LIMIT 20')->fetchAll();
	?>
	<table id="tasks">
		<thead>
			<tr class="thead_subtitle">
				<th>#</th>
				<th><span lang="en">Player Name</span></th>
				<th><span lang="en">Points</span></th>
				<th><span lang="en">Difficulty</span></th>
			</tr>
		</thead>
		<tbody>
			<?php
			$numer = 1;
			foreach ($ranking as $gracz) {
				echo '
				<tr class="tablerow">
					<td align="center">' . $numer . '.</td>
					<td><a href="' . WEBSITE . 'index.php/character/view/' . $gracz['name'] . '">' . $gracz['name'] . '</a></td>
					<td>' . $gracz['score'] . '</td>
					<td>' . ucfirst($gracz['level']) . '</td>
				</tr>';
				$numer++;
			}
			?>
		</tbody>
	</table>

Reput mile widziany.

Zabraniam kopiowania zawarto?ci na inne fora/serwisy.

Notka moderatorska:
+10pkt do konkursu!
 
Status
Zamknięty.
Do góry