It's quite possible that this is impossible.. but here goes...

I have some personnel data that is being reported in a table and in that table I have a field that holds a person's "title". Let's say the returned "title" results are "President", "Vice President", "Assistant To The President" and "Assistant to the Vice President". There are not more than four of them. Does anybody have any idea if I could sort the returned results based on the above hierarchy - which is not alphabetical?

Here is my beginner's code:

echo "<center>\n";
echo "<H2>Roster</H2>\n";
echo "<table border='1'>
<th>First Name</th>
<th>Last Name</th>


if (mysql_num_rows($query)) {
    while ($row = mysql_fetch_array($query)) {
//table layout
echo "<tr align=\"center\" bgcolor=\"#EFEFEF\">\n";
echo "<td class=\"td_id\">$variable1</td>\n";
echo "<td class=\"td_id\">$variable2</td>\n";
echo "<td class=\"td_id\">$variable3</td>\n";

Thanks for looking at it!

Sorting non-alphabetical/non-numerical records is not possible AFAIK. But you can have one more field of type int in the table, eg, type. You can enter the order of title, then sort by type !

Took your advice and all is well. thanks.

Great! You are welcome !