- or download this
# Table name: levels
level_id level_name
...
2 Secondary Two
3 Secondary Three
4 Secndary Four
- or download this
# Table name: profiles
member_id
...
.
.
joined
- or download this
my $sql = qq{ SELECT * FROM profiles, levels
WHERE member_id=23
...
$sth->execute();
my $hashref = $sth->fetchrow_hashref();
# So level name is stored in $hashref->{level_name}
- or download this
# In a separate file from the main script
our %levels = (
...
3 => Secondary Three,
4 => Secndary Four
);
- or download this
my $sql = qq{ SELECT * FROM profiles, levels WHERE member_id=23 };
my $sth = $dbh->prepare($sql);
$sth->execute();
my $hashref = $sth->fetchrow_hashref();
So level name can be retrived via $levels{$hashref->{level_id}}