Well, I tried another 2 days worth of trial and error with any possible combination of your above comments.
i.e.
...&Category=Planning+Systems&view_cat1=1
...&Category=Planning+Systems&view_records=1
...&$db_key=Planning+Systems&view_cat1=1
...&$db_key=ID&view_cat1=1 etc...
So with my plain-Jane html_view_cat1 page, I was wondering if we can go about this in a different manner.
In my default.cfg
Field#2=Category
Field#3=SubCategory
The following code is used to search field #2 (Category)
Code:
$fieldnum = 2;
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
if (!(grep $_ eq $fields[$fieldnum], @values)) {
push (@values, $fields[$fieldnum]);
}
}
close DB;
Is there a way to have it check field #3 in within this code? Here is a stab in the dark:
Code:
$fieldnum = 2;
$Subfieldnum = 3;
open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
if ($Subfieldnum eq "Planning Systems") {
@fields = &split_decode ($line);
if (!(grep $_ eq $fields[$fieldnum], @values)) {
push (@values, $fields[$fieldnum]);
}
}
}
close DB;
I mean, I am so close with the original code. It does print out the values for field 2 perfectly. All I need now is to have it print those values IF field 3 equals "Planning Systems".