Matt thanks for the reply. The column is part of a table in a MySQL database. Sorry should have been clearer. Here's the basic format to maybe make it clearer:
# A B C D E
1 T F 8 2 S
2 T G 6 4 R
3 T G 5 2 R
4 T F 8 7 S
5 T H 1 9 S
.......
Sorry for the lame column names, but thats the only way I could get it to line up. Hope its not too confusing.
The T's stand for text and # is the primary key (auto_increment).
The table has many more rows in it. What I'm essentially looking to do is sort C and only display the highest 5 values. When there is a numberical equivalence, as in # 1 and 4, then D will be used to determine which value is higher on the sorting list.
As for the second question I asked above, I am asking to do the same thing I mentioned previously just this time have the sorting done for item only where E=R and where B=F.
Here’s what I have so far to output the table, but I am clueless when it comes to try to sort it.
<?php
// Set the variables for the database access:
$Host = "localhost";
$User = "username";
$Password = "password";
$DBName = "dbname";
$TableName = "table";
$Link = mysql_connect ($Host, $User, $Password);
$Query = "SELECT * from $TableName";
$Sort = $Query
$Result = mysql_db_query ($DBName, $Query, $Link);
// Create table.
print ("<table border=0 width=\"75%\" cellspacing=0 cellpadding=0 align=center>\n");
print ("<tr align=center valign=top>\n");
print ("<td align=center valign=top>Name:</td>\n");
print ("<td align=center valign=top>Location:</td>\n");
print ("<td align=center valign=top>Catch Date:</td>\n");
print ("<td align=center valign=top>Weight:</td>\n");
print ("<td align=center valign=top>Length:</td>\n");
print ("<td align=center valign=top>Picture:</td>\n");
print ("</tr>\n");
// Fetch results from database.
while ($Row = mysql_fetch_array ($Result)) {
print ("<tr align=center valign=top>\n");
print ("<tr align=center valign=top>\n");
print ("<td align=center valign=top>$Row[FirstName] $Row[LastName]</td>\n");
print ("<td align=center valign=top>$Row[City], $Row[State]</td>\n");
print ("<td align=center valign=top>$Row[Date]</td>\n");
print ("<td align=center valign=top>$Row[lbs]lbs $Row[oz]oz</td>\n");
print ("<td align=center valign=top>$Row[Length] inches</td>\n");
print ("<td align=center valign=top>$Row[PicLink]</td>\n");
print ("</tr>\n");
}
print ("</table>\n");
mysql_close ($Link);
?>
Thanks again.