Add multiply rows on a table. PHP-MySQL
<p>I retrieve part of the below mentioned code from the following url: <a href="http://stackoverflow.com/questions/779986/insert-multiple-rows-via-a-php-array-into-mysql">insert multiple rows via a php array into mysql</a>
However I face a problem. My code is as following:</p>

<pre><code>//create an array
$array = array();

//add some values

//1st var_dump($array);
var_dump($array);

$msql = array(); 
foreach( $array as $row ) {
    $msql[] = '('.$row['trend'].', '.$row['image_url'].','.$row['sku'].')';
}

 var_dump($msql);   



 $insertData = "INSERT INTO Data_Info (trend, image_url,sku) VALUES ".implode(',', $msql);
 mysql_query($insertData) or die(mysql_error());

 mysql_close($conn);
</code></pre>

<p>The table that I have created contains three fields-> trend, image_url,sku.</p>

<p>Results of the 1st var_dump:</p>

<pre><code>array(6) { 
   [0]=&gt; string(7) "mytrend" 
   [1]=&gt; string(70) "http://re.n.o.coat.png" 
   [2]=&gt; string(12) "militarycoat" 
   [3]=&gt; string(7) "mytrend" 
   [4]=&gt; string(73) "http://re.n.o.padded.png" 
   [5]=&gt; string(15) "signaturepadded" 
} 
</code></pre>

<p>Results of the 2n var_dump:</p>

<pre><code>array(6) {
   [0]=&gt; string(8) "(m, m,m)" 
   [1]=&gt; string(8) "(h, h,h)" 
   [2]=&gt; string(8) "(m, m,m)" 
   [3]=&gt; string(8) "(m, m,m)" 
   [4]=&gt; string(8) "(h, h,h)" 
   [5]=&gt; string(8) "(s, s,s)" 
} 
Unknown column 'm' in 'field list'
</code></pre>

<p>I can't understand what is going wrong. Can anyone help me?</p>
