Database operations - Query logging.php 284 Bytes
Newer Older
1

hansbrix's avatar
hansbrix committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<code type="php">

// works only if you use doctrine database handler

$dbh = $conn->getDBH();

$times = $dbh->getExecTimes();

// print all executed queries and their execution times

foreach($dbh->getQueries() as $index => $query) {
    print $query." ".$times[$index];
}

</code>