You should make a link like:
<a href="db.cgi?db=second_database&do=search_results&foreign_key=<%primary_key_of_the_first_database%>&foreign_key-opt=="><%primary_key_of_the_first_database%><a>
foreign_key: should be the field name which will be related to the first database.
TheStone.
B.
<a href="db.cgi?db=second_database&do=search_results&foreign_key=<%primary_key_of_the_first_database%>&foreign_key-opt=="><%primary_key_of_the_first_database%><a>
foreign_key: should be the field name which will be related to the first database.
TheStone.
B.