Gossamer Forum
Quote Reply
Help with Join
Hi all, long time lurker and I'm in need of some help with a global. I found a similar usage in the forums and tried to adapt it to my situation with no luck. Code follows:
sub {
my $sth = $DB->table('Links')->do_query(qq|select ID,Maker,Family,Title from glinks_Links inner join glinks_CatLinks on ID=LinkID inner join glinks_Category on CategoryID=glinks_Category.ID order by Maker,Family,Title|);
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
push @loop, $hit;

return { knifemaker_loop=> \@loop }


If I only do the first two joins (any two joins for that matter) it works. Add the third and I get a build error (the 4th line fails on the fetchrow_hashref because of an undefined something or other).

Any thoughts? My goal is to create a loop that I can use as a left nav to show the following:

. Title1
. Title2
. Title3
. etc

The reason I need the joins is because I ultimately need to add where Name='whatever' (from the Category table) to the select. I'm very new to perl/SQL so this is way beyond me.


My Green Promise: To learn (and practice) as much as I can about living a sustainable life and then spreading the word.
What's your Green Promise?
Quote Reply
Re: [kthull] Help with Join In reply to
Please turn on debugging and paste the full error. "Something or other" is hard to debug Cool