Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

magento 2 db connection

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection('MagentoFrameworkAppResourceConnection::DEFAULT_CONNECTION'); 
$results = $connection->fetchone($query);
 
PREVIOUS NEXT
Tagged: #magento #db #connection
ADD COMMENT
Topic
Name
4+9 =