Hi guys
I've created a database with two tables; one called "SfP_Music" and the other "SfP_Composers", the tables are connected in a many to one relationship. The "music" table has a column in it called "composer_id" which is a foreign key from the Composers table and allows me to link a piece of music and its composer together.
My problem scenario is as follows. A user adds a piece of music to the database and selects from a drop down list the relevant composer (generated via a global from the composers table).
What I want to do is display the "human" readable name for the composer (stored in the column "Name" in the composers table) rather than the 'Composer_id' that is currently returned on the add_success page.
I have attempted doing this through a global with the following code, but it doesn't seem to work.
sub {
my $tags = shift;
my $table = $DB->table('SfP_Composers');
my $sth = $table->get('Composer_ID', 'HASH', ['Name']);
my $output .= $sth;
}
I hope someone can point me in the right direction!
Cheers,
Hannah
I've created a database with two tables; one called "SfP_Music" and the other "SfP_Composers", the tables are connected in a many to one relationship. The "music" table has a column in it called "composer_id" which is a foreign key from the Composers table and allows me to link a piece of music and its composer together.
My problem scenario is as follows. A user adds a piece of music to the database and selects from a drop down list the relevant composer (generated via a global from the composers table).
What I want to do is display the "human" readable name for the composer (stored in the column "Name" in the composers table) rather than the 'Composer_id' that is currently returned on the add_success page.
I have attempted doing this through a global with the following code, but it doesn't seem to work.
sub {
my $tags = shift;
my $table = $DB->table('SfP_Composers');
my $sth = $table->get('Composer_ID', 'HASH', ['Name']);
my $output .= $sth;
}
I hope someone can point me in the right direction!
Cheers,
Hannah