title: SQL relational insert to 2 tables in single query without resorting to mysql_insert_id()
body: <p>I'm not totally new to SQL, but am rusty and struggle with MYSQL (using PhPMyAdmin)... looked at this: <a href="https://stackoverflow.com/questions/3225024/mysql-insert-to-multiple-tables-relational">MySQL insert to multiple tables (relational)</a>
  and some other related topics, but haven't found an answer. I'm simplifying my example to get the point across.</p>
  
  <p>If you have two tables: </p>
  
  <pre><code>'table1' has: id (primary key, auto-increment), description (text)
  'table2' has: id (primary key, auto-increment), title (text), description_id (int)
  </code></pre>
  
  <p>How do I create a singe INSERT statement so that <code>description_id</code> is storing the value for <code>table1.id</code> ?</p>
  
  <p>I know there are php ways to do 2 queries but I'd like to do it all in  SQL, there must be a way? Should I set up my tables differently? <a href="https://stackoverflow.com/questions/7324780/mysql-foreign-key-relations-vs-mysql-insert-id-to-relate-tables">I read something about foreign keys</a> and have no idea if that's applicable.</p>
  
  <p>Thanks!</p>