Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [ManuGermany] SELECT QUESTION

Quote Reply
Re: [ManuGermany] SELECT QUESTION In reply to
Hi Manu,

As you mentioned that StoreID is not a primary key in 'stores' table, so you cannot use the 'queries' feature which is very useful for relational database.

In your case, you can create a global template which will get product's information:

sub {
my $tags = GT::Template->tags;
my $record = $tags->{results}[$tags->{row_num}-1];
my $store_id = $record->{StoreID};
my $info = $tags->{home}->{sql}->table('stores')->get({ StoreID => $store_id });
return %$info;
}

Change search_results.html like:

<%loop results%>
<%global_template_name%>
......<%StoreNames%> <%LogoURL%>
<%endloop%>

P.s: I think that you should use the 'queries' feature which is much faster than this way.

TheStone.

B.

Last edited by:

TheStone: Jan 7, 2003, 10:31 AM
Subject Author Views Date
Thread SELECT QUESTION ManuGermany 3256 Jan 7, 2003, 12:34 AM
Thread Re: [ManuGermany] SELECT QUESTION
604 3156 Jan 7, 2003, 10:16 AM
Post Re: [TheStone] SELECT QUESTION
ManuGermany 3147 Jan 7, 2003, 11:16 AM