Magento 2 Custom Query

<?php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();

$sql = "Select * FROM customer_entity" ;
$result = $connection->fetchAll($sql); 
print_r($result);
?>

One thought on “Magento 2 Custom Query”

  1. Pingback: Google

Leave a Reply

Your email address will not be published. Required fields are marked *