In your first message you posted the following code -
sub {
my $table = shift;
my $results = $DB->table($table)->select()->fetchall_hashref;
return { loop_select => $results };
}
It should be -
sub {
my $table = 'table_name';
my $results = $DB->table($table)->select()->fetchall_hashref;
return { loop_select => $results };
}
See if that makes a difference.
If you use my code it should look something like -
sub {
#Include all tags
my $tags = GT::Template->tags;
#Pull the field from the database
my ($some_name) = $DB->table('t_phonec')->select({field_name_in_other_table => $tags->{field_name_in_search_results} }, ['phonec_id'])->fetchrow_array();
#Assign the field to $tags
$tags->{phonec_id}=$some_name;
#Return. The field should be available in your template as <%phonec_id%>
return; }
**You need to give it a field in both tables to search on, I don't know your table set up so I can't give you the field names.
One of the above should help.
Simon
sub {
my $table = shift;
my $results = $DB->table($table)->select()->fetchall_hashref;
return { loop_select => $results };
}
It should be -
sub {
my $table = 'table_name';
my $results = $DB->table($table)->select()->fetchall_hashref;
return { loop_select => $results };
}
See if that makes a difference.
If you use my code it should look something like -
sub {
#Include all tags
my $tags = GT::Template->tags;
#Pull the field from the database
my ($some_name) = $DB->table('t_phonec')->select({field_name_in_other_table => $tags->{field_name_in_search_results} }, ['phonec_id'])->fetchrow_array();
#Assign the field to $tags
$tags->{phonec_id}=$some_name;
#Return. The field should be available in your template as <%phonec_id%>
return; }
**You need to give it a field in both tables to search on, I don't know your table set up so I can't give you the field names.
One of the above should help.
Simon