Problem import information from csv file with PHP

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
rapha0704
New php-forum User
New php-forum User
Posts: 1
Joined: Fri Sep 25, 2020 1:45 am

Fri Sep 25, 2020 1:49 am

Hello,
I would like to retrieve information from a csv file on drive in php here is the piece of code in question which does not seem to work.

Code: Select all

foreach ($imports->setColumns($imports->getTable() . '.*')->getBy(array('id !=' => ''))->convertRecords() as $imp){

	$imp->getById($imp->id);

	if ( ! $imp->isEmpty() and ! empty($imp->template)){

	$options = array_merge($imp->options, $imp->template);

	$this->__ver_4_transition_fix($options);
	
	$imp->set(array(
		'options' => $options
	))->update();

	if ($imp->type == 'file'){
	$imp->set(array(
	'path' => $uploads['basedir'] . DIRECTORY_SEPARATOR . self::FILES_DIRECTORY . DIRECTORY_SEPARATOR . basename($imp->path)
	))->update();
	}
}

Thank you in advance for your answers.
chorn
php-forum GURU
php-forum GURU
Posts: 688
Joined: Fri Apr 01, 2016 2:18 am

Fri Sep 25, 2020 3:31 am

$imports is undefined.
Post Reply