Here is my exact code and im always getting an error of Undefined offset in my array
<?php
require_once('../../../Backend/Listings_Database/Listings_Connection.php');
$Response = array();
if($_FILES["file"]["size"] > 0) {
$filename=$_FILES["file"]["tmp_name"];
$file = fopen($filename, "r");
while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE) {
(name,brand,cat_id,
store_size,location_floor_unit,phone,traffic_of_mall,
time_of_traffic,city)
values('$emapData[0]','$emapData[1]','$emapData[2]',
'$emapData[3]','$emapData[4]','$emapData[5]',
'$emapData[6]','$emapData[7]','$emapData[8]')";
//we are using mysql_query function. it returns a resource on true else False on error
$result = mysqli_query($sql,$Listings_Database);
if(! $result ) {
$Response[] = "Fail";
} else {
$Response[] = "Success";
}
}
fclose($file);
$Response[] = "Success";
mysqli_close($Listings_Database);
} else {
$Response[] = "Fail";
}
var_dump($Response);
print json_encode($Response);
?>
Here is my exact code and im always getting an error of Undefined offset in my array