title: Insert data in table2 with reference of data in table1
body: <p>I have 2 tables named <code>owners_info</code>: <code>id</code> <code>unique_id</code> and <code>timeinlog</code>: <code>timein_id</code> <code>id</code> <code>time_in</code></p>
  
  <p>The <code>id</code> in second table is FK of <code>id</code> in first table.</p>
  
  <p>The thing is, the <code>unique_id</code> is the RFID Tag that reader reads. I just want to insert the time in <code>time_in</code> in second table when the TAG is detected by the reader. </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is what i have now <code>INSERT INTO timeinlog (timein_id, id, time_in) VALUES (NULL, SELECT id FROM owners_info WHERE u_id = 123, NOW());</code></p>