Hi JPD!
Not to worry, you made yourself clear about what needed to be removed. I was just having great difficulty getting the records to return with any consistancy. They would come back with dates, ID #s, etc. in the search results instead of titles! From my previous experience with database programming, I knew this had to be something like a missing delimiter or invalid fields or something similar. So I decided for the time being to take one step back before trying to go two steps forward. I did save a copy (actually 2 or 3) of the original file, but I may go back and start from scratch.
================================================
Do you want to offer visitors a choice to sort by another field,
or do you want to make it always be by category?
================================================
Because users can only view and search, I think I want to make Category the default sort when using the "List ALL" feature.
But users should be able to chose another sort option when they are using the search feature's drop-down options. The only problem I see with this is that the Category headers still print in the final result. Could the print code be written with a variable so that whichever field is chosen as a sort criteria, that would be the field used as a header? i.e.,:
unless ($last_"VARIABLE" eq $rec{'"VARIABLE" '}) {
print qq|<td><$font><font size="+2" font color="red">
<b>$rec{' "VARIABLE" '}</b></font></font></td></tr><tr>|;
$last_"VARIABLE" = $rec{' "VARIABLE" '};
}
or would it be neccessary to write a series of "IF" statements like:
if sb=4
unless ($last_category eq $rec{'Category'}) {
print qq|<td><$font><font size="+2" font color="red">
<b>$rec{'Category'}</b></font></font></td></tr><tr>|;
$last_category = $rec{'Category'};
}
etc.
Just a thought, though I know my code has to be way off, but I think you'll understand what I mean.
Meanwhile, I'll make the changes you suggest to the sub html_search_options for two reasons:
1) I just like it better and because I understand it, it will be easier to edit in the future, AND
2) It allows me to control which fields will be made available for sorting (we go through all the trouble to make a nice list sorted by category and some numbskull comes in and sorts by ID# - WHY?).
Anyway, talk to you later. I am on my way to the store for extra cinnamon!
BB
[This message has been edited by BigBritchs (edited June 09, 1999).]