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.'\']]';
}
for($i=0;$i<$number_rows_excel;$i++){
$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
thanks
Total Views: 8 Today Views: 0















