PHP : how to detect row and column number from HTML table?
<p>So, I have a form with a HTML table.</p>

<p>Each box of the table contains a text field. Each of those fields have the same name like this :</p>

<pre><code>&lt;input name="quantity[]" type="text" /&gt;
</code></pre>

<p>The HTML table looks like this :</p>

<p><a href="https://i.stack.imgur.com/iapci.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iapci.jpg" alt="html table with text fields"></a></p>

<p>Row are numbers. Columns are month.
Users have to put a number (a quantity) in at least one box.</p>

<p>Then, they can submit the form.</p>

<p>My SQL table should be like this :</p>

<pre><code>Number - Month - Quantity
222000 - 12 - 50
222000 - 02 - 31
300000 - 01 - 25
221000 - 02 - 28
</code></pre>

<p>As you see, 1 line in my table = 1 input text.</p>

<p>In PHP, I get the data like this :</p>

<pre><code>foreach($_POST['quantity'] as $key =&gt; $text_field){
    if(!empty($text_field)) {
        $requete = $bdd-&gt;prepare('INSERT INTO my table VALUES(:number, :month, :quantity)');
        $requete-&gt;execute(array(
            ':number' =&gt; *???*,
            ':month' =&gt; *???*,
            ':quantity' =&gt; $text_field
        ));
    }
}
</code></pre>

<p>My question : how to detect the row number and the column number from my HTML table in PHP and put the result into my SQL table?</p>