|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-22 10:09 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Jan 03 02:00:01 2026 UTC |
Description: ------------ Hi, Could you add a (MySQL) query logger? It'd log each query, including the duration and number of rows affected. This is very useful to diagnose slow pages. See below for an idea of what interface could be provided. Reproduce code: --------------- mysql_log_queries(true); mysql_query("select * from T"); $a = mysql_get_log(); foreach ($a as $row) { printf("%.1f ms - %d rows - %s", $row['duration'], $row['affected_rows'], htmlspecialchars($row['query'])); } Expected result: ---------------- - Actual result: -------------- -