I'm very new to magento 2.3, I'm facing some error maybe from DB side....
Here is my code:
/app/code/EC/Customimport/Controller/Adminhtml/Index/Import.php
<?php
namespace EC\Customimport\Controller\Adminhtml\Index;
use EC\Customimport\Model\CustomimportFactory;
use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;
class Import extends \Magento\Backend\App\Action
{
protected $request;
/**
* @param Context $context
*/
public function __construct(
\Magento\Framework\App\Request\Http $request,
Context $context,
CustomimportFactory $modelCustomimportFactory
) {
$this->request = $request;
$this->modelCustomimportFactory = $modelCustomimportFactory;
$this->resultFactory = $context->getResultFactory();
parent::__construct($context);
}
public function execute(){
ignore_user_abort(true);
set_time_limit(0);
$ids = $this->getRequest()->getParams('customimport_id');
$model = $this->modelCustomimportFactory->create()->load($id);
$model->import();
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect->setPath('adminhtml/*/index');
return $resultRedirect;
}
}
ERROR:
SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s),
query was:
SELECT `customimport`.* FROM `customimport`
WHERE
(`customimport`.`customimport_id`='true', '4', 'FrFt7XBKVOwNwaq2')
customimport
.customimport_id
='true', '4', 'FrFt7XBKVOwNwaq2')?customimport
is a table in myDB
&customimport_id='4'