Hi,
Alright, just make a little change:
....
my $db = $home->{cgi}->{db};
my $table = $DB->table($db);
$table->select_options("Order by $column",$limit);
my $cond = GT::SQL::Condition->new ();
if ($home->{cgi}->{mul}) { #search words
my $words = [split /\s/,$letter];
$cond->{bool} = 'OR';
foreach (@$words) {
($_) and $cond->add($column,'LIKE',"%$_%");
}
}
else { # search starting with a letter
$cond->add($column,'LIKE',"$letter%");
}
my $sth = $table->select ($cond);
my $hits = $table->hits();
....
It should work for both, if you wanna search words then pass mul=1 or add <input name=mul value=1 type=hidden> in your search form.
Cheers,
TheStone.
B.
Alright, just make a little change:
....
my $db = $home->{cgi}->{db};
my $table = $DB->table($db);
$table->select_options("Order by $column",$limit);
my $cond = GT::SQL::Condition->new ();
if ($home->{cgi}->{mul}) { #search words
my $words = [split /\s/,$letter];
$cond->{bool} = 'OR';
foreach (@$words) {
($_) and $cond->add($column,'LIKE',"%$_%");
}
}
else { # search starting with a letter
$cond->add($column,'LIKE',"$letter%");
}
my $sth = $table->select ($cond);
my $hits = $table->hits();
....
It should work for both, if you wanna search words then pass mul=1 or add <input name=mul value=1 type=hidden> in your search form.
Cheers,
TheStone.
B.