I would like to use mysql query profiler in the php script. So that after i execute any queries it need to display the execution time of the query.
Suggest the best way to use this also share any other scripts like query profiler.
I would like to use mysql query profiler in the php script. So that after i execute any queries it need to display the execution time of the query.
Suggest the best way to use this also share any other scripts like query profiler.
set profiling to 1 before the start of your script
$mysqliObj->query("SET profiling = 1");
Right after the executing the query which you want to profile, execute the following one
$mysqliObj->query("SELECT query_id, SUM(duration) FROM information_schema.profiling GROUP BY query_id ORDER BY query_id DESC LIMIT 1;")