dynamic row inserts - mysql php - how?
<p>Hy to all, </p>

<p>I have a misunderstanding regarding some dynamic row inserts in a mysql table...</p>

<p>All I want to do is based on the EAV Model : </p>

<ul>
<li>I have a products table wich contains products</li>
<li>A attributes table wich contains attributes (name) for products (group based - related to category)</li>
<li>And a product_attribute wich cotains the value of the attribute ...</li>
</ul>

<p>And the user must create this attributes to be associated with a product, and I'm thinking to insert <code>&lt;input&gt;</code> elements with jquery's <code>append</code>.</p>

<p>But how to track inserts and how to append them to have a specific name : <code>&lt;input name=''&gt;</code>.</p>

<p>The result shoul do the following :</p>

<pre><code>&lt;form action='attribute_insert.php' method='post'&gt;
&lt;input name='field1' /&gt;
&lt;input name='field2' /&gt;
&lt;input name='field3' /&gt;
....
&lt;input name='field20' /&gt;
&lt;/form&gt;
</code></pre>

<p>and after processing in <code>attribute_insert.php</code> to insert like this :</p>

<pre><code>('1', '12', 'manufacturer');
('2', '12', 'freq');
('3', '12', 'memory');
('4', '12', 'ram');
....
('20', '12', 'blablabla');
</code></pre>

<p>How can i do this ... using <code>foreach</code> to scan the <code>$_POST[]</code> or there is a clever method ?</p>

<p>Thank you very much ...</p>
