Answers for "magento 2 get connection"

PHP
0

magento 2 get connection

$om = \Magento\Framework\App\ObjectManager::getInstance();
$connectionO = $om->create('Magento\Framework\App\ResourceConnection');
$connection= $connectionO->getConnection();

$sql = 'some query';
$results = $connection->fetchAll($sql);
Posted by: Guest on August-25-2020

Browse Popular Code Answers by Language