Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: Re: [jiliu] merging records: Edit Log

Here is the list of edits for this post
Re: [jiliu] merging records
Hi,

Follow the steps below:

- Create a group_data subroutine in Global template:
sub {
my $tags = shift;
my $results = $tags->{results};
my $col = $tags->{column};
($results) or return;
my $last_val;
foreach (@$results) {
if(not defined $last_val or $last_val ne $_->{$col}) {
$_->{group} = 1;
$last_val = $_->{$col};
}
}
}

- Modify your search_results.html like:
.....
<%set column = 'group_field_name'%>
<%group_data%>
<%loop results%>
<%if group%><b><%group_field_name%></b><%endif%>
<%field2%>.....
<%endloop%>
.....

Cheers,

TheStone.

B.

Last edited by:

TheStone: Jan 11, 2002, 5:53 PM

Edit Log: