store form values in database
<p>I have a form in which i use two dimensional array for field names.The fields names are below</p>

<p>myform[message][]</p>

<p>myform[name][]</p>

<p>myform[add][]</p>

<p>it means there are three arrays.Every array has arrays inside it.when i var_dump my form after putting values and submitting it.I get the below structure of 2d array.</p>

<pre><code>array
  ''message'' =&gt; 
    array
      0 =&gt; string 'adnan' (length=5)
      1 =&gt; string 'khan' (length=4)
      2 =&gt; string 'salman' (length=6)
  ''name'' =&gt; 
    array
      0 =&gt; string 'khan' (length=4)
      1 =&gt; string 'kamran' (length=6)
      2 =&gt; string 'khan' (length=4)
  ''add'' =&gt; 
    array
      0 =&gt; string 'asad' (length=4)
      1 =&gt; string 'khan' (length=4)
      2 =&gt; string 'abrar' (length=5)
</code></pre>

<p>As you can see the associative array.I want to store the values of message,name and add in a database table having three fields to store the values of message,name and add fields in a single query by using some loop like foreach.
when i use this code</p>

<pre><code>foreach($_REQUEST['myform'] as $val)
 foreach($val as $v)

  {
    echo $v;
  }
</code></pre>

<p>I get all the values of the array.But i think i am unable to save it to database table</p>

<p>as all the values are in the variable $v.How to store message in a message field,name in name field and add in an add field in a table of a db.</p>

<p>please advice.Thanks</p>
