mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fixed issue: Importing CSV with empty columns at end of file causing failure
This commit is contained in:
@@ -308,8 +308,11 @@ function import_file($file, $description, $fields, $firstrow = 2)
|
|||||||
* insert into sample_var field
|
* insert into sample_var field
|
||||||
*/
|
*/
|
||||||
foreach($selected_name as $key => $val)
|
foreach($selected_name as $key => $val)
|
||||||
{
|
{
|
||||||
$dkey = $db->Quote($data[$key - 1]);
|
if (isset($data[$key -1 ]))
|
||||||
|
$dkey = $db->Quote($data[$key - 1]);
|
||||||
|
else
|
||||||
|
$dkey = $db->Quote("");
|
||||||
|
|
||||||
$sql = "INSERT INTO sample_var (sample_id,var_id,val)
|
$sql = "INSERT INTO sample_var (sample_id,var_id,val)
|
||||||
VALUES ('$sid','{$sirv_id[$key]}',{$dkey})";
|
VALUES ('$sid','{$sirv_id[$key]}',{$dkey})";
|
||||||
|
|||||||
Reference in New Issue
Block a user