title: How to insert this data to mysql php
body: <pre><code>Array
  (
      [id] =&gt; Array
          (
              [0] =&gt; 1
              [1] =&gt; 1
              [2] =&gt; 1
          )
  
      [kind] =&gt; Array
          (
              [0] =&gt; 1
              [1] =&gt; 2
              [2] =&gt; 3
          )
  
      [qty] =&gt; Array
          (
              [0] =&gt; 123
              [1] =&gt; 456
              [2] =&gt; 789
          )
  
  )
  </code></pre>
  
  <p>This is how my data look like.Here is my insert 1 row code</p>
  
  <pre><code>function insert($table, $array_data)
  {
      $key = array();
      $value = array();
      foreach($array_data as $v=&gt;$row){
          $key[] = $v;
          $value[] = "'".$row."'";
      }
      $data_key = implode(',', $key);
      $data_value = implode(',', $value);
  
      $sql = "INSERT INTO ".$table."(".$data_key.") VALUES (".$data_value.")";
      $this-&gt;setQuery($sql);
      $this-&gt;query();
  }
  </code></pre>
  
  <p>Please help me make a function to insert multi rows somethings like</p>
  
  <pre><code>function insert_multi($table, $array_data)
  {
      ...
  
      $sql = "INSERT INTO ".$table."(".$data_key.") VALUES (".$data_value1."), (".$data_value2.")";
      $this-&gt;setQuery($sql);
      $this-&gt;query();
  }
  </code></pre>
  
  <p>I'm trying many ways but only return empty value or "Array" string. My point is make those value turn into this 
  <code>INSERT INTO table (id, kind, qty) VALUES (1, v2, v3), (1, v2.1, v3.1),...</code><br>
  Many thanks! ^^</p>