title: Saving a data on a table and registering them per batch
body: <p>I am having trouble designing my web app database.
  I want to save every item the user will input but each item must be registered to a transaction id.
  It is possible to do this on a single user only but when there are multiple users, the items are jumbled.</p>
  <p>Below is my table design.</p>
  <p><strong>User_Table</strong></p>
  <hr />
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>User_id</th>
  <th>Name</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>3</td>
  <td>John</td>
  </tr>
  <tr>
  <td>4</td>
  <td>Mary</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Items_Table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Items_id</th>
  <th>User_Id</th>
  <th>Item Name</th>
  <th>Price</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>3</td>
  <td>Car</td>
  <td>10.00</td>
  </tr>
  <tr>
  <td>---------------</td>
  <td>---------------</td>
  <td>--------------------</td>
  <td>------------------</td>
  </tr>
  <tr>
  <td>2</td>
  <td>3</td>
  <td>Bike</td>
  <td>5.00</td>
  </tr>
  <tr>
  <td>---------------</td>
  <td>---------------</td>
  <td>--------------------</td>
  <td>------------------</td>
  </tr>
  <tr>
  <td>3</td>
  <td>4</td>
  <td>Strawbery</td>
  <td>20.00</td>
  </tr>
  <tr>
  <td>---------------</td>
  <td>---------------</td>
  <td>--------------------</td>
  <td>------------------</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>So to sum it up:
  John had made a (first)transaction  with a total price of : 15.00</p>
  <p>My problem is that what if I want to create another transaction but the system will just add up the last transaction I made.</p>
  <p>Solutions taken:</p>
  <p>Create a logs id of each transaction id and load it in the form so that when the user adds an item the system will log that the new item entered by John will be a new transaction. But what if some technical error happens like Johns computer freezes, and the transaction is not saved and Mary took the id that was supposed to be Johns. My main problem here is how to make my data reliable and accurate when keeping records. I hope someone helps me.</p>