Database operations - Query logging.php 281 Bytes
Newer Older
doctrine's avatar
doctrine committed
1 2 3 4
<?php

// works only if you use doctrine database handler

5
$dbh = $conn->getDBH();
doctrine's avatar
doctrine committed
6 7 8 9 10 11 12 13 14 15

$times = $dbh->getExecTimes();

// print all executed queries and their execution times

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

?>