I have dynamic form like below.
<form action="edit.php" method="post">
<tr>
<th scope="row" class="specalt">Product A</th>
<td class="alt"><input class="input2" type="text" name="s_8" value="100" /></td>
<td class="alt"><input class="input2" type="text" name="m_8" value="100" /></td>
<input type='hidden' name='id_8' value='8' />
</td>
</tr>
<tr>
<th scope="row" class="specalt">Product B</th>
<td class="alt"><input class="input2" type="text" name="s_9" value="234" /></td>
<td class="alt"><input class="input2" type="text" name="m_9" value="23" /></td>
<input type='hidden' name='id_9' value='9' />
</td>
</tr>
<input type="submit" name="submit" value="Edit" />
</form>
The name="s_9"
, name="m_9"
, name='id_9'
is dynamic which can be any id on the last according to current input.
Question
How to save this input to mysql? because all input will store to different table
What should i code into edit.php?