Of course this is possible, let's say we had the link for sorting by field2 something like;
<a href="myscript.php?sort=field2">Sort by field2</a>
then within myscript.php you would simply have to check the variable $sort against the column names and sort by the specified column, if the column doesn't exist then simply reset it back to field1 (or whatever).
HTH
Matt