📜  magento 2 db 连接 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:40.880000             🧑  作者: Mango

代码示例1
$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);