dudaoruconfig.php page
$csv _key_name) { $result _arr[$i] [$csv _key_name] = $data _line[$csv _key_num]; } $i + +; } return $result _arr;}? >
dodaoru.php
dodaoru2.php
dodaoru3.php
$table _real_column_name) {if ($j = = count ($table _real_column_name_arr)) {$csv _line_data_value. = "'". $r esult_arr[$i] [$csv _real_key_name]. "' "; }else{$csv _line_data_value. = "'". $result _arr[$i] [$csv _real_key_name]. "',"; } $j + +; } $all _insert_data_value_str. = "($csv _line_data_value),";} $all _insert_data_value_str = substr ($all _insert_data_value_str,0,-1); Remove the last comma//piece together all field names that need to be inserted into a long string of SQL statements $all_insert_column_name_str = ""; $i = 1;foreach ($table _real_column_name_arr As $csv _real_key_name=> $table _real_column_name) {if ($i = = count ($table _real_column_name_arr)) {$all _insert_co Lumn_name_str. = "$table _real_column_name"; }else{$all _insert_column_name_str. = "$table _real_column_name,"; } $i + +;} Issue, 1 text in the case of a carriage return result in a string with escape character import failed, 2 garbled//Execute batch INSERT, CSV import complete $query = mysql_query ("INSERT into $tableName ($all _insert_ COLUMN_NAME_STR) values $all _insert_data_value_str ");//BULK INSERT in Datasheet fclose ($csv _file); if ($query) {ECho ' Import succeeded! ';} else{echo ' Import failed! ';}? >
dodaoruajax.php