Usage example:
Title (Manufacturer)
URL (Model Number) - Internal link to Detailed page
I'm using the global below to add a button to the Detailed page so visitors can list all other products by that manufacturer.
If the Title is Adam, it lists everything with that title.
If the Title is Adam & Eve it lists everything with that title.
If the Title is Adam&Eve it seams to list everything beginning with A.
The SQL table Title field is always entered as &.
Is there anything I can add to the global to correct this?
my $tbl = $DB->table('Links');
$tbl->select_options("ORDER BY URL");
my $title = $IN->param('title');
my $sth = $tbl->select( GT::SQL::Condition->new('isValidated','=',"Yes",'Title','LIKE',"$title%") );
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
if ($CFG->{build_detailed}) { $hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} ); }
if ($hit->{isNew} eq "Yes") { $hit->{isNew} = 1; } else { $hit->{isNew} = 0; }
if ($hit->{isPopular} eq "Yes") { $hit->{isPopular} = 1; } else { $hit->{isPopular} = 0; }
if ($hit->{isChanged} eq "Yes") { $hit->{isChanged} = 1; } else { $hit->{isChanged} = 0; }
push @loop, $hit;
}
return { links_loop => \@loop };
}
Title (Manufacturer)
URL (Model Number) - Internal link to Detailed page
I'm using the global below to add a button to the Detailed page so visitors can list all other products by that manufacturer.
If the Title is Adam, it lists everything with that title.
If the Title is Adam & Eve it lists everything with that title.
If the Title is Adam&Eve it seams to list everything beginning with A.
The SQL table Title field is always entered as &.
Is there anything I can add to the global to correct this?
Code:
sub { my $tbl = $DB->table('Links');
$tbl->select_options("ORDER BY URL");
my $title = $IN->param('title');
my $sth = $tbl->select( GT::SQL::Condition->new('isValidated','=',"Yes",'Title','LIKE',"$title%") );
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
if ($CFG->{build_detailed}) { $hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} ); }
if ($hit->{isNew} eq "Yes") { $hit->{isNew} = 1; } else { $hit->{isNew} = 0; }
if ($hit->{isPopular} eq "Yes") { $hit->{isPopular} = 1; } else { $hit->{isPopular} = 0; }
if ($hit->{isChanged} eq "Yes") { $hit->{isChanged} = 1; } else { $hit->{isChanged} = 0; }
push @loop, $hit;
}
return { links_loop => \@loop };
}