Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: Finding more than "own" records on searches

Quote Reply
Re: Finding more than "own" records on searches In reply to
I'm still working on finding a solution to this problem and haven't yet come up with one. It appears this may be a bug in the query sub in db.cgi. This only happens with keyword searches. Someone else posted a problem with getting both "validated" and "unvalidated" records when doing a keyword search. Seems like a similar problem.

This is the piece of code from sub_query that has to do with keyword searching:

Code:

# If this is a keyword search, we want to set every field in the database to the
# search term.
if ($in{'keyword'}) {
$in{'ma'} = "on"; $bool = 'OR';
foreach $column (@db_cols) {
next if ($db_lengths{$column} > 255); # Can't search on TEXT/BLOB fields.
next if ($in{'keyword'} !~ /^\d+$/ and $db_is_int{$column});
push (@search_fields, $column); # Search every column
$in{$column} = $in{'keyword'}; # Fill %in with keyword we are looking for.
}
}

What can I modify to make it skip the UserID field when populating all fields with the keyword? There's no need to search on the UserID in my database because the user will only be able to search his/her own records. I don't mind losing the ability to do a keyword search on UserID as an administrator because, frankly, I can't think of a time I've ever needed to do that.

I'd appreciate a nudge in the right direction. Thanks!

Melanie
http://www.somemoorecats.com/ww/
http://www.okhima.org/
Subject Author Views Date
Thread Finding more than "own" records on searches msmoore 3905 Feb 4, 2001, 2:44 PM
Thread Re: Finding more than "own" records on searches
msmoore 3795 Feb 5, 2001, 9:18 PM
Post Re: Finding more than "own" records on searches
Katana Man 3767 Feb 5, 2001, 10:22 PM
Thread Re: Finding more than "own" records on searches
Alex 3766 Feb 6, 2001, 2:27 PM
Post Re: Finding more than "own" records on searches
msmoore 3760 Feb 6, 2001, 3:11 PM
Post Re: Finding more than "own" records on searches
Katana Man 3785 Feb 6, 2001, 3:55 PM
Post Re: Finding more than "own" records on searches
Katana Man 3727 Feb 15, 2001, 8:44 AM