title: Mysql Auto Increment For Group Entries
body: <p>I need to setup a table that will have two auto increment fields. 1 field will be a standard primary key for each record added. The other field will be used to link multiple records together.</p>
  
  <p>Here is an example. </p>
  
  <pre><code>field 1  |  field 2
    1           1
    2           1
    3           1
    4           2
    5           2
    6           3
  </code></pre>
  
  <p>Notice that each value in field 1 has the auto increment. Field 2 has an auto increment that increases slightly differently. records 1,2 and 3 were made at the same time. records 4 and 5 were made at the same time. record 6 was made individually.</p>
  
  <p>Would it be best to read the last entry for field 2 and then increment it by one in my php program? Just looking for the best solution.</p>