Gossamer Forum
Home : Products : DBMan : Customization :

doing something wrong in db.cgi with ww=on

Quote Reply
doing something wrong in db.cgi with ww=on
I've been playing and changing a lot with dbman, and I guess I f**ked up something.

if I do this:
-site- /cgi-bin/scripts/db.cgi?db=HS&uid=default&Paginanummers=87&view_records=1&aos2=yes

it finds the records with Paginanummers 87 and 187

If I do this:

-site- /cgi-bin/scripts/db.cgi?db=HS&uid=default&Paginanummers=87&view_records=1&aos2=yes&ww=on

it finds nothing.

I don't know where to look for solving this. So hints are welcome!

Thanks.
Quote Reply
Re: [Lex] doing something wrong in db.cgi with ww=on In reply to
Try using &ww=1 rather than &ww=on

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] doing something wrong in db.cgi with ww=on In reply to
tried that, to no avail...
Quote Reply
Re: [Lex] doing something wrong in db.cgi with ww=on In reply to
I know this may be a long shot but try putting the ww=1 prior to view_records and see if that helps

for instance try:

/cgi-bin/scripts/db.cgi?db=HS&uid=default&Paginanummers=87&ww=on&aos2=yes&view_records=1

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [Lex] doing something wrong in db.cgi with ww=on In reply to
I was thinking it had something to do with character vs. numeric but the bit of the db.cgi that does the matching uses \b$foo\b

specifically:

Code:
foreach $field (@search_fields) {
my $tmpreg = "$in{$db_cols[$field]}";
(!$in{'re'}) and ($tmpreg = "\Q$tmpreg\E");
($in{'ww'}) and ($tmpreg = "\\b$tmpreg\\b");
(!$in{'cs'}) and ($tmpreg = "(?i)$tmpreg");
($in{$db_cols[$field]} eq "*") and ($tmpreg = ".*"); # A "*" matches anything.
$regexp_func[$field] = eval 'sub { m/$tmpreg/o; }';
$regexp_bold[$field] = $tmpreg;

\b matches alpha-numeric word boundaries

so $foo = "bob 123"

$foo =~ /\b123\b/ you get true

$foo =~/\b1\b/ you get false

$foo =~ /\b1/ you get true

Basically that's to say that I couldn't replicate your problem, but I did try.
Quote Reply
Re: [Watts] doing something wrong in db.cgi with ww=on In reply to
Watts:

My first thought was also whether or not the field was defined as a number in the cfg file and whether that would make a difference.

For example:

'ID' => [ 0,'numer',5,10,1,'', ''],

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] doing something wrong in db.cgi with ww=on In reply to
I was (am) thinking something along the same lines..

...a few minutes later...

nope, just tested it on a standard dbman installation and searching for ID "3" brings up 3, 13, 31, etc, but checking
the whole words checkbox brings up only record #3 (with ID field defined as "numer".