Jump to content

[SOLVED] got tricked here..need help to this wierd problem


smilesmita

Recommended Posts

i had huge xml string...got it parsed and converted into an flat array which looks like this:[i am using this as an example]

 

$data2=array(

 

[a_0]=>'test'

[b_1]=>'test1'

[c_2]=>'test3'

[a_1]=>'test4'

[c_4]=>'test5'

 

)

 

did preg_replace on $data2 as $k=>$v

and now got it to be like this

 

$data3=array(

 

[a]=>'test'

=>'test1'

[c]=>'test3'

[a]=>'test4'

[c]=>'test5'

 

)

here i got tricked...because now when i give my insert statement it looks like this:

insert into table (a,b,c,a,c) Values('test,'test1','test3','test4','test5');

 

becaues you cannot specify a columname more than once in the sql query...

any idea how i could resolve this?may be if i could rename the second occurence of same name..that would solve it...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.