package booker; require Exporter; our @ISA = ("Exporter"); sub Get_Booking_Course_Event { my $BookingID = shift; my $dbh = DBI->connect("DBI:mysql:database=foo", "bar", "baz") or die $DBI::errstr; my $sth; $sth = $dbh->prepare("SELECT * FROM booking WHERE BookingID = $BookingID") or die $dbh->errstr; $sth->execute(); $ref_booking = $sth->fetchrow_hashref; $sth = $dbh->prepare("SELECT * FROM event WHERE EventID = $ref_booking->{'EventID'}") or die $dbh->errstr; $sth->execute(); $ref_event = $sth->fetchrow_hashref; $sth = $dbh->prepare("SELECT * FROM course WHERE CourseID = $ref_booking->{'CourseID'}") or die $dbh->errstr; $sth->execute(); $ref_course = $sth->fetchrow_hashref; } our @EXPORT = qw/Get_Booking_Course_Event/; 1;