2
0
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:
Adam Zammit
2016-06-15 11:42:17 +10:00
parent 9c676deaf4
commit d8e8eee5d6

View File

@@ -308,8 +308,11 @@ function import_file($file, $description, $fields, $firstrow = 2)
* insert into sample_var field
*/
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)
VALUES ('$sid','{$sirv_id[$key]}',{$dkey})";