Answers for "magento 2 db connection"

PHP
0

magento 2 db connection

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection('\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION'); 
$results = $connection->fetchone($query);
Posted by: Guest on August-20-2020

Browse Popular Code Answers by Language