Gossamer Forum
Home : Products : DBMan SQL : Discussion :

3 sections on 1 page

Quote Reply
3 sections on 1 page
Hey

I am trying to get some different database results to show up in 3 sections on my web page.

I use this sub

execute_search_results
Code:
sub {
my $opts = shift;
my $tags = GT::Template->tags;
my $home = $tags->{home};
my @opts = split ('&',$opts);
foreach (@opts) {
next if (!$_);
my ($n,$v) = split('=',$_);
if ($n) {
$home->{cgi}->{$n} = $v || $home->{cgi}->{$n};
}
}
local $home->{cfg} = $home->_load_cfg ($home->{cgi}->{db});
local $home->{db} = $home->{sql}->table ($home->{cgi}->{db});
my $results = $home->search_results;
foreach (keys % $results) { $tags->{$_} = $results->{$_}; }
return $results;
}
On my page I call execute_search_results 3 times.
Code:
<%execute_search_results("db=db&midem_a=Ja")%>
<%if hits%>
<%include sektionA.html%>
<%endif%>
<%execute_search_results("db=db&midem_b=ja")%>
<%if hits%>
<%include sektionB.html%>
<%endif%>
<%execute_search_results("db=db&midem_c=Ja")%>
<%if hits%>
<%include sektionC.html%>
<%endif%>

if I just call it 1 time it works perfect, but when I call execute_search_results 3 times it only shows the results from the first search.

Is it not possible to call the sub execute_search_results 3 times on the same page ?? or is there some thing I don't understand.

I hope somebody can help me. i have searched the forum but I haven't been able to find a solution.

Niels
Subject Author Views Date
Thread 3 sections on 1 page nielsp 5512 Sep 20, 2003, 4:05 PM
Thread Re: [nielsp] 3 sections on 1 page
604 5336 Sep 22, 2003, 10:07 AM
Thread Re: [TheStone] 3 sections on 1 page
nielsp 5345 Sep 22, 2003, 11:59 AM
Thread Re: [nielsp] 3 sections on 1 page
604 5336 Sep 22, 2003, 1:13 PM
Thread Re: [TheStone] 3 sections on 1 page
nielsp 5327 Sep 22, 2003, 1:34 PM
Thread Re: [nielsp] 3 sections on 1 page
604 5322 Sep 22, 2003, 1:47 PM
Thread Re: [TheStone] 3 sections on 1 page
nielsp 5327 Sep 22, 2003, 3:10 PM
Post Re: [nielsp] 3 sections on 1 page
604 5324 Sep 22, 2003, 3:30 PM