title: Merging mysql data from two tables into one dataset and updating
body: <p>I have two identical tables with different names which I would like to merge into one useable array dataset using some sort of query. I've heard the UNION function is good for this however I have never used it before.</p>
  
  <p>OK so heres some pseudo table code:</p>
  
  <p>TABLE_1 &amp; TABLE_2</p>
  
  <p>The query I would use to get data from both tables would be:</p>
  
  <pre><code>SELECT col_1, col_2 FROM TABLE_ WHERE ...
  
  ╔═════════╦═══════════╗
  ║ col_1   ║   col_2   ║
  ╠═════════╬═══════════╣
  ║      37 ║         1 ║
  ║      37 ║         2 ║
  ║     ... ║       ... ║
  ╚═════════╩═══════════╝
  </code></pre>
  
  <p>How could I combine the data from both tables to get one dataset? I would also like to update records in the dataset but how could I do this if I don't know what table the data originated from?</p>
  
  <p>Thanks in advance.</p>