I have a MySQL query called $sqlStr5
that ranks rows by a metric called totalScore2
. One of the fields that $sqlStr5
returns is called username
.
I would like to echo out the rank and the value of totalScore2
where username
equals a variable called $u
.
How can I do this?
Below is what I have so far.
Thanks in advance,
John
$result = mysql_query($sqlStr5);
$count = 1;
$arr = array();
while ($row = mysql_fetch_array($result)) {
echo '<div class="sitename1edit2a">'.$count++.'.</div>';
echo '<div class="sitename1edit2">'.number_format(($row["totalScore2"])).'</div>';
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…