title: Using an insert id from first of three queries in php
body: <p>I want to store the data from several curl calls to an initial table, but last insert id is inserting wrong info </p>
  
  <p>Query 1 inserts data into table</p>
  
  <p>table1</p>
  
  <pre><code>   id name      email      valuereturn
     1   val     val@email.com       0
  </code></pre>
  
  <p>I then post data 3 times to my system and log it</p>
  
  <p>table2</p>
  
  <pre><code>    id  name    system  valuereturn
      1   val      5       0
      2   val      0       0
      3   val      0       0
  </code></pre>
  
  <p>the max value returned from my system i want to update table 1</p>
  
  <pre><code>update table1 
  set valuereturn = '5' 
  where id = LAST_INSERT_ID()
  </code></pre>
  
  <p>does not work because last insert id is 3 from table2, how can I use something like <code>last_insert_id(Table1)</code>?</p>
  
  <p>i want to update my</p>