我遇到了下面的错误A必需字段“摘要”为空。请重新检查您的inputs.Can,任何人建议如何继续。
我已经映射了import中的摘要列,但仍然显示错误。
<?php
class Csv_importPlugin extends MantisPlugin
{
function register() {
$this->name = plugin_lang_get( 'title' );
$this->description = plugin_lang_get( 'description' );
$this->version = '2.0.0';
$this->requires = array( 'MantisCore' => '2.0.0' );
$this->author = 'Bug 4220 Team';
$this->contact = 'https://github.com/mantisbt-plugins/csv-import/';
$this->url = 'https://github.com/mantisbt-plugins/csv-import/';
$this->page = 'config';
}
function config() {
return array(
'import_issues_threshold' => MANAGER ,
);
}
function hooks() {
return array(
'EVENT_MENU_MANAGE' => 'csv_import_menu',
);
}
function csv_import_menu() {
return array(
'<a href="' . plugin_page( 'import_issues_page_init' ) . '">' . plugin_lang_get( 'manage_issues_link' ) . '</a>',
);
}
}发布于 2019-03-02 22:47:02
尝尝这个。不需要插件
假设您有一个包含文件列的CSV文件
$file = $_FILES['csv_file']['tmp_name']; //get CSV file
$handle = fopen($file, "r"); //handle
while(($filesop = fgetcsv($handle, 1000, ",")) !== false){ //start while loop
$sname = $filesop[0];
$fname = $filesop[1];
$oname = $filesop[2];
$gender= $filesop[3];
$country= $filesop[4];
// Put your SQL code to insert before while loop ends
} //end while loophttps://stackoverflow.com/questions/54958513
复制相似问题