I retrieve part of the below mentioned code from the following url: insert multiple rows via a php array into mysql However I face a problem. My code is as following:
//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);
The table that I have created contains three fields-> trend, image_url,sku.
Results of the 1st var_dump:
array(6) { 
   [0]=> string(7) "mytrend" 
   [1]=> string(70) "http://re.n.o.coat.png" 
   [2]=> string(12) "militarycoat" 
   [3]=> string(7) "mytrend" 
   [4]=> string(73) "http://re.n.o.padded.png" 
   [5]=> string(15) "signaturepadded" 
} 
Results of the 2n var_dump:
array(6) {
   [0]=> string(8) "(m, m,m)" 
   [1]=> string(8) "(h, h,h)" 
   [2]=> string(8) "(m, m,m)" 
   [3]=> string(8) "(m, m,m)" 
   [4]=> string(8) "(h, h,h)" 
   [5]=> string(8) "(s, s,s)" 
} 
Unknown column 'm' in 'field list'
I can't understand what is going wrong. Can anyone help me?
 
     
     
     
    