in reply to Re: Querying data with and & or when using DBIx::Class
in thread Querying data with and & or when using DBIx::Class
Thanks for the help. I have done reading, but what I have tried was giving me errors. I had something similar to your first to examples.
method get_my_mixedskills( $id, $color1, $color2 ) {
my $whrcls;
if(!$color2){
$whrcls = "ID => $id, color => $color1";
}
else {
$whrcls = "-and => [
-or => [
color => $color1,
color => $color2, ],
ID => $id, ], "
}
my @myskills_objs = $schema->resultset( 'TblSkillSelected' )->search({ $whrcls },
{ order_by => 'SID' });
}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Querying data with and & or when using DBIx::Class
by Your Mother (Archbishop) on Sep 17, 2013 at 14:31 UTC | |
by phildeman (Scribe) on Sep 17, 2013 at 20:31 UTC | |
by Your Mother (Archbishop) on Sep 17, 2013 at 20:48 UTC | |
by phildeman (Scribe) on Sep 17, 2013 at 20:35 UTC |