I'm attempting to implode a multi-dimensional array with the characters )
,(
, so that
i can use a query similar to this:
insert into table temp (a,b,c) values ('a','b','c'),('d','e','f');
Here is an example of the multidimentional array:
$tmp = array(
array(0 => 'CompanyB',
1 => 'IndustryA',
2 => 'Sysadmin',
3 => '01',
4 => '2011',
5 => '12',
6 => '2012',
7 => 'aeere',
8 => 'R6000',
9 => 'asdfasdf'),
array(0 => 'CompanyC',
1 => 'IndustryC',
2 => 'Aabb',
3 => '02',
4 => '2012',
5 => '01',
6 => '2013',
7 => 'asdf',
8 => 'R7000',
9 => 'adfasdfeeeeeeeeeeeeeee'),
array(0 => 'CompanyD',
1 => 'IndustryARR',
2 => 'NJNNLK',
3 => '01',
4 => '2011',
5 => '01',
6 => '2012',
7 => 'Anotheron',
8 => 'R9000',
9 => 'qweqweqwe'));
this does not produce any result, print implode("),(",$tmp);
I'm not a professional php developer, maybe there's an easier way to do this. Appreciate your input.