Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: Re: [ManuGermany] SELECT QUESTION: Edit Log

Here is the list of edits for this post
Re: [ManuGermany] SELECT QUESTION
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

Edit Log: