I have two tables in my MySQL database, here they are:
I want to have some records with fields that are not predefined at the table creation stage, so I can use that pair of tables to store records with different fields set.
I fill those tables with the following records:
And I want to write select query that would return following result:
Is there any way to do that in MySQL, or should I select both tables and process them in PHP to achieve the result I need?
UPD: Please mention that I don't know what will be the names of the fields beforehand, so I can't hardcode 'name's of the fields into the select query.