A simple way of creating a default sort field and sort order would be to add the following to your .cfg file:
$sort_field ='3';
$sortorder = 'ascend'; OR: $sortorder = "descend';
Then just use the variable in your links, form, etc. This makes it very easy to change if your sort order, and you can easily use the same db.cgi files for various databases.
Just change the 3 to match the field you want to sort by.
Examples:
In your footer you could use:
<A HREF="$db_script_link_url&view_records=1&$db_key=*&sb=$sort_field&so=$sortorder>View All Entries</A> ! if ($per_view);
In various forms including sub html_view_search you could add extra hidden fields:
<input type="hidden" name="sb" value="$sort_field">
<input type="hidden" name="so" value="$sortorder">
Hope this helps
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/