Re: Ranking function in PHP/MySQL
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Sun, 07 Oct 2007 09:36:15 -0400
macca wrote:
Just to insert some php in here to satisfy the die hards, in order to
display your ranking order you could do this:
$sql = "SELECT casualtyID, deathdate FROM the_table ORDER BY deathdate
ASC";
$result = mysql_query($sql,$connection) or die(mysql_error());
for ($i=0; $i < mysql_num_rows($result); $i++){
$casualtyID = mysql_result($result,$i,"casualtyID");
$death_date = mysql_result($result,$i,"deathdate");
$rank = $i+=1;
echo "$casualtyID is the number $rank casualty to die in the current
wars in Iraq and Afghanistan\n";
}
The most stoopid argument I've seen in this group in ages.
The question was about how to do something in SQL. The answer was how to do it in SQL.
Wrapping some stupid *** like this around it does not make it a PHP question.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: Ranking function in PHP/MySQL
- From: The Natural Philosopher
- Re: Ranking function in PHP/MySQL
- References:
- Re: Ranking function in PHP/MySQL
- From: Rik Wasmus
- Re: Ranking function in PHP/MySQL
- From: Shelly
- Re: Ranking function in PHP/MySQL
- From: Jerry Stuckle
- Re: Ranking function in PHP/MySQL
- From: Shelly
- Re: Ranking function in PHP/MySQL
- From: Jerry Stuckle
- Re: Ranking function in PHP/MySQL
- From: macca
- Re: Ranking function in PHP/MySQL
- Prev by Date: Re: Ratings????
- Next by Date: Re: Ranking function in PHP/MySQL
- Previous by thread: Re: Ranking function in PHP/MySQL
- Next by thread: Re: Ranking function in PHP/MySQL
- Index(es):