in reply to Combining two fetches with DBI and MySQL

You're looking for a left join:
select table1.name as left_name, table2.name as right_name from table1 left join table2 on table1.name=table2.name
Then you can make the name bold when left_name eq right_name. right_name will be undef if the left_name doesn't occur in table2.

I suggest you read up on relational databases, foreign keys, natural vs. synthetic keys etc. Your model smells of denormalisation.