title: Most efficient way to do Mysql Multi select (and insert if not exists)
body: <p>I have 20 tables with 2 fields, id and name description </p>
  
  <pre><code>Colors
  id  name
  1 black
  2 blue 
  ...
  
  Sizes
  id name  
  1 100
  2 105
  ...
  </code></pre>
  
  <p>Now i have the main table with 21 fields</p>
  
  <pre><code>Main table `shoes`
  
  id Colors Sizes style ...
  1    2     24     11
  </code></pre>
  
  <p>I have a form post with  20 text inputs (one for each kind of feature, color, size..) 
   what i want is to learn the most efficient way to look at 20 features tables (Select id from colors where name='blue') and get the id value, if not exists, create it ( insert into colors (name) values (pink) ) and then get the id ,once I have the 20 values ​​will do the big insert into the main field</p>