php looping two arrays
<pre><code>$arr1 = array(
    1 =&gt; array(
        30 =&gt; 100
        31 =&gt; 800
    ),
    2 =&gt; array(
        30 =&gt; 200
        31 =&gt; 900
    ),
    3 =&gt; array(
        30 =&gt; 300
        31 =&gt; 100
    ),
    4 =&gt; array(
        30 =&gt; 400
        31 =&gt; 110
    ),
    5 =&gt; array(
        30 =&gt; 500
        31 =&gt; 120
    ),
    6 =&gt; array(
        30 =&gt; 600
        31 =&gt; 130
    ),
    7 =&gt; array(
        30 =&gt; 260
        31 =&gt; 140
    )
);
</code></pre>

<p>&nbsp;</p>

<pre><code>$arr2 = array(
    0 =&gt; array(
        id =&gt; 30  
    ),
    1 =&gt; array(
        id =&gt; 31          
    )
)
</code></pre>

<p>I need to loop through the $arr1 and insert in this fashion</p>

<pre><code>INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('30','1',100);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('30','2',200);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('30','3',300);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('30','4',300);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('30','5',500);
</code></pre>

<p>and so on </p>

<pre><code>INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('31','1',900);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('31','2',900);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('31','3',100);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('31','4',110);
INSERT INTO tablename (option_value_id,duration_id,price) VALUES ('31','5',120);    
</code></pre>

<p>and so on. How can i do this?</p>
