smilesmita Posted August 10, 2007 Share Posted August 10, 2007 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... Link to comment https://forums.phpfreaks.com/topic/64308-solved-got-tricked-hereneed-help-to-this-wierd-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.