hello all i am having very unusuall issue here my code is below
if (isset($_POST['csvSubmit'])) {
$mimes = array('application/vnd.ms-excel','text/plain','text/csv','text/tsv');
if(in_array($_FILES['csv']['type'],$mimes)){
$file = $_FILES['csv']['tmp_name'];
$handle = fopen($file,"r");
$count=0;
while (($data = fgetcsv($handle, 100000, ',')) !== FALSE) {
if($count>0){
mysqli_query($connection,"INSERT INTO `csv_sheet` (`cscid`, `csfname`, `cslname`, `csemail`, `csphone`, `csdep`, `csgender`, `csdob`, `csdate`, `csip`) VALUES ('0', '$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]','$data[6]','$data[7]','$data[8]')");
}
$count++;
}
print "File Uploded Successfully";
fclose($handle);
}
else{
die("Sorry, This file type not allowed");
}
}
Error
Notice: Undefined offset: 7 in C:\xampp\htdocs\site\action\csv_import.php on line 45
Notice: Undefined offset: 8 in C:\xampp\htdocs\site\action\csv_import.php on line 45
File Uploded Successfully
while the file is imported sucessfully but i get to see this error every time please suggest me what to do here and also help me to understand the code