in reply to Re: AoH refs for setting HTML::Template loops
in thread AoH refs for setting HTML::Template loops
Spent a few hours reading, and ended up combining some of jeffa's node and some of dragonchild's, all with much consideration of gmax's educational nodes on database programming.
Here's the much reduced, working version:
my $stmt = "SELECT xm_branches.id AS value, xm_branches.name AS branch + FROM xm_users, xm_branches, xm_userbranches WHERE xm_users.username = '$user' AND xm_userbranches.user_id = xm_users.id AND xm_userbranches.branch_id = xm_branches.id"; &execute_it($stmt); $template = HTML::Template -> new(filename => "../xm_dialogs/editmenu. +tmpl"); $template->param( branches => $sth->fetchall_arrayref({}));
Lessons learned: normalize that database and let the it do the work (also some unseen DBI stuff from gmax). Still need to work on INNER JOINs. Thanks all.
|
|---|