Sort the contents on a record field

Hello:

When I call up a specific record, I need to sort the contents of “tblpartmanuf” and replace that field with the sorted information. Lets say the record is:

tblpartnumber tblpartmanuf
12544 GFSD

After I edit some other fields, automatically sort the tblpartmanuf field so that it is:
12544 DFGS

$sql=“SELECT tblpartnumber, tblpartmanuf FROM tblparts WHERE tblpartnumber =‘$frmpartfinder’”;
$result = mysql_query($sql) or die('Error: ’ . mysql_error());

why can’t you do this in php once you’re retrieved the row?