I'm developing an Application that uses a page PHP
where I will have a ranking of points that the user makes when performing some interaction with it. I have a script that generates the list in order (from highest to lowest) showing from first place to last.
But I want to HIGHLIGHT the user who makes the query, passed through a form ( $ user = $ _GET ['user']; ), formatting his line in Bold. I think it's an IF condition but I can not get to the problem resolution.
Quote my current code, working perfectly, but without highlighting the user making the query.
$usuario =$_GET['usuario'];
$conexao = mysqli_connect('XXXXXXX','XXXXXX','XXXXXXX');
mysqli_select_db($conexao,'XXXXXX');
$sql="select * from login order by pontos DESC";
$resultado = mysqli_query($conexao,$sql) or die ("Erro: " . mysqli_error());
$posicao = 1; //variavel
echo <table width='90%' style='padding:10px;'><tr><td width='20%'><b>Class.</td><td width='60%'><b>Participante</td><td width='20%'><b>Pontos</td>";
//faz um looping e cria um array com os campos da consulta
while($array = mysqli_fetch_object($resultado)) {
echo "<tr><td>";
echo $posicao; // COLUNA DA POSIÇÃO NO RANKING
echo "</td><td>";
echo $array->usuario; // AQUI EU QUERO UM IF PARA DIFERENCIAR O USUÁRIO PASSADO LÁ EM CIMA.
echo "</td><td>";
echo $array->pontos; // coluna dos pontos
echo "</td></tr>";
$posicao = $posicao + 1; // acumula próxima posição até terminar
}
echo "</table>"