i am uploading csv file.It is correctly upload in the folder. but data is not displaying when i given echo $row['adv_title']. this my controller.I want to display the title
public function upload{
$config['upload_path'] = APPPATH.'/assets/upload/';
$config['allowed_types'] = 'csv';
$config['max_size'] = '5000';
$replace='"';
$this->load->library('upload', $config);
$this->load->database();
if ( ! $this->upload->do_upload('file_name'))
{
$error=array('error' => $this->upload->display_errors());
$this->session->set_flashdata('msg_excel','Choose a .csv file to upload');
redirect(base_url().'admin/advertisement/adv');
}
else
{
$data=array('upload_data' => $this->upload->data());
$userfile=$data['upload_data']['file_name'];
$upload_data=$this->upload->data();
$this->load->library('csvreader');
$file=$upload_data['full_path'];
$file_name=$upload_data['userfile'];
$data=$this->csvreader->parse_file($file);
foreach($data as $row)
{
echo "hiii".$row['adv_title'];
}
}
what is the problem?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire