1
hello, I’d like to know how I can number the table by numbers, example, each would have their indicator as I’m making 1 top 100 players and wanted to number each with the position number
public function Skywars()
{
$stmt = $this->pdo->prepare("SELECT * FROM tskywars INNER JOIN tcommons ON tskywars.id = tcommons.id INNER JOIN permusers ON tcommons.id = permusers.id ORDER BY `solowins` DESC LIMIT 100");
$stmt->execute();
if($stmt->rowCount() == 0) { return ""; }
$fetch = $stmt->fetchAll(\PDO::FETCH_OBJ);
$return = "";
foreach ($fetch as $rs)
{
$deaths = "".number_format($rs->solodeaths, 0, ',', '.');
$wins = "".number_format($rs->solowins, 0, ',', '.');
$kills = "".number_format($rs->solokills, 0, ',', '.');
$coins = "".number_format($rs->coins, 0, ',', '.');
$color = "background: ";
switch($rs->groups){
case "Diretor": $color."orange;"; break; // se for diretor
case "Ajudante": $color."yellow;"; break; // se for ajudante
default : $color."black;";
}
// insere a cor
$return .= "
<tr>
<td style=\"padding:10px;\" class=\"position\">1.</td>
<td><img src=\"https://minotar.net/helm/{$rs->name}/24.png\"></td>
<td style=\"padding:10px;\"><span style=\"color:#fff;padding:5px;$color\">{$rs->groups}</span> <span style=\"font-weight:200;\">{$rs->name}</span></td>
<td style=\"padding:10px;\">$wins</td>
<td style=\"padding:10px;\">$kills</td>
</tr>";
}
return $return;
}
Hello! You say number the line
<td style=\"padding:10px;\" class=\"position\">1.</td>
. Sequence? type first line 1., second line: 1, third line: 3. This?– Fabiano Monteiro
this, the first table would be 1, the second would be 2 and so on
– Matheus Ferreira