Jump to content

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


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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.