8
0
Bifurcation 0
oxid-sql-logger/example/simple.php

20 lignes
594 B
PHP
Brut Vue normale Historique

2019-08-20 23:34:33 +02:00
<?php
require __DIR__ . '/../../../../source/bootstrap.php';
2019-09-20 16:05:36 +02:00
\D3StartSQLLog('Query for 100 items cheaper than 49,99');
2019-08-20 23:34:33 +02:00
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$list = $db->getAll('SELECT * '.PHP_EOL.'FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
2019-08-20 23:34:33 +02:00
2019-09-20 16:05:36 +02:00
\D3StopSQLLog();
// or
\D3StartSQLLog();
$db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
$list = $db->getAll('SELECT * FROM oxarticles WHERE oxprice < ? LIMIT 100', [49.99]);
\D3StopSQLLog();