Merge #17064 - Fix #17014 - column names in first row when importing from CSV where the first line contains column names
Pull-request: #17064 Fixes: #17014 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
d1afd1d5ac
@ -16,6 +16,8 @@ use PhpMyAdmin\Properties\Options\Items\BoolPropertyItem;
|
||||
use PhpMyAdmin\Properties\Options\Items\NumberPropertyItem;
|
||||
use PhpMyAdmin\Properties\Options\Items\TextPropertyItem;
|
||||
use PhpMyAdmin\Util;
|
||||
|
||||
use function array_shift;
|
||||
use function array_splice;
|
||||
use function basename;
|
||||
use function count;
|
||||
@ -572,6 +574,12 @@ class ImportCsv extends AbstractImportCsv
|
||||
}
|
||||
|
||||
$col_names = $this->getColumnNames($col_names, $max_cols, $rows);
|
||||
|
||||
/* Remove the first row if it contains the column names */
|
||||
if (isset($_REQUEST['csv_col_names'])) {
|
||||
array_shift($rows);
|
||||
}
|
||||
|
||||
$tbl_name = $this->getTableNameFromImport((string) $db);
|
||||
|
||||
$tables[] = [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user