title: Saving data with dynamic input name to database?
body: <p>Allright, before that i'm a beginner in PHP.
  So forgive me for this silly question.</p>
  
  <p>Say that id_user '1' have 2 items, so it will create 2 input form for each item.<br></p>
  
  <p>These are the input forms:</p>
  
  <pre><code>&lt;input value="0" type="text" name="store_&lt;?php echo $id= "I got this value from id.item in database, in this case '5'" ?&gt;" required="required"&gt;
  
  &lt;input value="0" type="text" name="take_&lt;?php echo $id= "I got this value from id.item in database, in this case '5'" ?&gt;" required="required"&gt; 
  
  &lt;input value="0" type="text" name="store_&lt;?php echo $id= "I got this value from id.item in database, in this case '6'" ?&gt;" required="required"&gt; 
  
  &lt;input value="0" type="text" name="take_&lt;?php echo $id= "I got this value from id.item in database, in this case '6'" ?&gt;" required="required"&gt;
  </code></pre>
  
  <p><strong>Note : value take_{id} and store_{id} are retrieved from table 'item' coloumn 'id_item' in database.</strong>
  <br><br>
  The user input these values : </p>
  
  <pre><code>*value 'store' for id_item 5 is 3
  *value 'take' for id_item 5 is 2
  *value 'store' for id_item 6 is 1
  *value 'take' for id_item 6 is 1
  </code></pre>
  
  <p>How do i save value 'store' and 'take' from user input to database with their associated id?
  Considering 1 user can have multiple item.</p>
  
  <p>This is table item.</p>
  
  <pre><code>    -&gt;id_user (referencing id_user from user's table)
      -&gt;id_item # this primary key
      -&gt;Take
      -&gt;Store
  </code></pre>
  
  <p>So the final result will be like this:</p>
  
  <pre><code>id_user : 1
  id_item : 5
  Store : 3
  Take : 2
  </code></pre>
  
  <p>And like this</p>
  
  <pre><code>id_user : 1
  id_item : 6
  Store : 1
  Take : 1
  </code></pre>
  
  <p>I've been googled all day, and i think regex with pattern 'store_<em>' and 'take_</em>' should do it? or there is another way to accomplish this?<Br>
  Thankyou :)</p>