looping inside the array_values function

i want to loop through the values of array which contain $i variable in it,

my code for array looks like this,

foreach($fields_names as $k => $v) {
      $handle_data[] ='$rowdata[$i][$fields_names[\''.$v.'\']]';


$sql.= "('".implode("','", array_values($handle_data))."'),". "<br/>";


when i am echoing $sql, i am getting like this ,

INSERT INTO eximport (`S.No`, `Patent#`, `Title`) VALUES ('$rowdata[$i][$fields_names['S.No']]','$rowdata[$i][$fields_names['Patent#']]','$rowdata[$i][$fields_names['Title']]')

it should have to display like this

INSERT INTO eximport (`S.No`, `Patent#`, `Title`) VALUES ('$rowdata[0][$fields_names['S.No']]','$rowdata[0][$fields_names['Patent#']]','$rowdata[0][$fields_names['Title']]')

please give little advices , how can i use the variable $i in it


Leave a Reply


Hire Me
Follow Me!
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.