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 12765 Oct 17, 2001, 10:02 AM
Thread Re: [kjetilpalm] Link to record starting with...
604 12512 Oct 17, 2001, 1:41 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12482 Dec 25, 2001, 11:42 AM
Thread Re: [jiliu] Link to record starting with...
604 12503 Dec 26, 2001, 9:50 AM
Thread Re: [TheStone] Link to record starting with...
jiliu 12510 Dec 26, 2001, 6:02 PM
Thread Re: [jiliu] Link to record starting with...
jiliu 12460 Dec 31, 2001, 10:12 AM
Thread Re: [jiliu] Link to record starting with...
604 12468 Dec 31, 2001, 10:57 AM
Thread Re: [TheStone] Link to record starting with...
jiliu 12459 Jan 11, 2002, 9:25 AM
Post Re: [jiliu] Link to record starting with...
604 12450 Jan 11, 2002, 9:40 AM
Thread Re: [jiliu] Link to record starting with...
604 12443 Jan 11, 2002, 12:16 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12463 Jan 11, 2002, 12:55 PM
Thread Re: [jiliu] Link to record starting with...
604 12476 Jan 11, 2002, 1:42 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12390 Jan 12, 2002, 2:17 PM
Thread Re: [jiliu] Link to record starting with...
604 12409 Jan 14, 2002, 8:58 AM
Thread Re: [TheStone] Link to record starting with...
jiliu 12413 Jan 14, 2002, 10:48 AM
Thread Re: [jiliu] Link to record starting with...
jiliu 12285 Apr 19, 2002, 11:55 AM
Thread Re: [jiliu] Link to record starting with...
604 12240 Apr 19, 2002, 2:08 PM
Thread Re: [TheStone] Link to record starting with...
jiliu 12264 Apr 20, 2002, 8:46 PM
Thread Re: [jiliu] Link to record starting with...
604 12206 Apr 22, 2002, 9:10 AM
Post Post deleted by jiliu
jiliu 12210 Apr 22, 2002, 9:37 AM
Post Re: [TheStone] Link to record starting with...
jiliu 12215 Apr 22, 2002, 10:14 AM
Thread Re: [TheStone] Link to record starting with...
gatman 11937 Feb 23, 2003, 5:32 AM
Thread Re: [gatman] Link to record starting with...
ManuGermany 11953 Feb 23, 2003, 12:22 PM
Post Re: [ManuGermany] Link to record starting with...
gatman 11891 Feb 23, 2003, 1:14 PM