Unable to insert value in db when inside foreach() and for()
<p>When a form is posted it is passed on as a <code>value1,value2,value3, value4</code>.  It has been exploded as individual values. 
Everything works well except for when I am trying to insert the <code>value1,value2,value3</code> into <code>$variable[$i]</code> it is not inserted into the table.  But when <code>echo $variable[$i];</code> it works fine.</p>

<p>Any idea on why the values are not inserted into the db.</p>

<pre><code>foreach ($_POST['ECB'] as $lx) {

for($i=0;$i&lt;=$Count;$i++) { 
        $k += mysql_num_rows($el);
    echo $variable[$i];
        mysql_select_db($database_m, $m);
        $query_stat = "Insert into table (field) values ('$variable[$i]')";
        $Result = mysql_query($query_stat, $m) or die(mysql_error());
    }

}
</code></pre>
