Gossamer Forum
Home : Products : DBMan : Customization :

searching userid or key

Quote Reply
searching userid or key
i have a database that has one record per user limit, thus userid is the key field. the userid's are numeric. i would like to be able to do a keyword search, enter the userid i want, and find the appropriate record. however, i always get no match found. if i do an "advanced search" and enter the userid in the userid field on the search form (instead of keyword field), it finds the record. in sub query, i think i've found the problem, but don't want to comment out the line without understanding its purpose. the offending line is indicated below. would there be unexpected problems from commenting this line? what is its purpose??? thanks in advance!

Code:
# First thing we do is find out what we are searching for. We build a list of fields
# we want to search on in @search_fields.
if ($in{'keyword'}) { # If this is a keyword search, we are searching the same
$i = 0; # thing in all fields. Make sure "match any" option is
$in{'ma'} = "on"; # on, otherwise this will almost always fail.
foreach $column (@db_cols) {
if (($db_sort{$column} eq 'date') or &date_to_unix($in{'keyword'})) { $i++; next; }
if ($i == $auth_user_field) { $i++; next; } ## THIS IS THE LINE ########################
push (@search_fields, $i); # Search every column
$in{$column} = $in{'keyword'}; # Fill %in with keyword we are looking for.
$i++;
}
}