Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [jiliu] Link to record starting with...

Quote Reply
Re: [jiliu] Link to record starting with... In reply to
Hi Jian,

You should modify your script like:
Code:
...
else {
$cond->add($column,'LIKE',"$letter%");
}
my $cols = $table->cols;
my $c = GT::SQL::Condition->new();
foreach ( keys % $cols ) {
if ( $home->{cgi}->{$_} ) {
my $opt = $home->{cgi}->{"$_-opt"} || 'LIKE';
( $opt eq 'LIKE' ) ? $c->add($_, $opt, "$home->{cgi}->{$_}%") : $c->add($_, $opt, $home->{cgi}->{$_});
}
}

my $sth = $table->select (GT::SQL::Condition->new($c, $cond));


Hope that helps.

TheStone.

B.

Last edited by:

TheStone: Apr 19, 2002, 2:09 PM
Subject Author Views Date
Thread Link to record starting with... kjetilpalm 12741 Oct 17, 2001, 10:02 AM
Thread Re: [kjetilpalm] Link to record starting with...
604 12490 Oct 17, 2001, 1:41 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12460 Dec 25, 2001, 11:42 AM
Thread Re: [jiliu] Link to record starting with...
604 12481 Dec 26, 2001, 9:50 AM
Thread Re: [TheStone] Link to record starting with...
jiliu 12488 Dec 26, 2001, 6:02 PM
Thread Re: [jiliu] Link to record starting with...
jiliu 12438 Dec 31, 2001, 10:12 AM
Thread Re: [jiliu] Link to record starting with...
604 12445 Dec 31, 2001, 10:57 AM
Thread Re: [TheStone] Link to record starting with...
jiliu 12437 Jan 11, 2002, 9:25 AM
Post Re: [jiliu] Link to record starting with...
604 12427 Jan 11, 2002, 9:40 AM
Thread Re: [jiliu] Link to record starting with...
604 12421 Jan 11, 2002, 12:16 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12441 Jan 11, 2002, 12:55 PM
Thread Re: [jiliu] Link to record starting with...
604 12454 Jan 11, 2002, 1:42 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12368 Jan 12, 2002, 2:17 PM
Thread Re: [jiliu] Link to record starting with...
604 12387 Jan 14, 2002, 8:58 AM
Thread Re: [TheStone] Link to record starting with...
jiliu 12391 Jan 14, 2002, 10:48 AM
Thread Re: [jiliu] Link to record starting with...
jiliu 12263 Apr 19, 2002, 11:55 AM
Thread Re: [jiliu] Link to record starting with...
604 12217 Apr 19, 2002, 2:08 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12242 Apr 20, 2002, 8:46 PM
Thread Re: [jiliu] Link to record starting with...
604 12184 Apr 22, 2002, 9:10 AM
Post Post deleted by jiliu
jiliu 12188 Apr 22, 2002, 9:37 AM
Post Re: [TheStone] Link to record starting with...
jiliu 12193 Apr 22, 2002, 10:14 AM
Thread Re: [TheStone] Link to record starting with...
gatman 11914 Feb 23, 2003, 5:32 AM
Thread Re: [gatman] Link to record starting with...
ManuGermany 11931 Feb 23, 2003, 12:22 PM
Post Re: [ManuGermany] Link to record starting with...
gatman 11868 Feb 23, 2003, 1:14 PM