phpMyAdmin - How to count data sent?


I use phpMyAdmin to manage my databases. I have always thought that it is quite interesting how they show how much traffic your server has handled:

How could I do something like this in my PHP code? Is there a function for this or would something like this involve metering every sql request?

I think this should work:

echo htmlspecialchars(shell_exec("ps -A"););;

Um, I think that just shows system processes and their PIDs.

Also, that code would give you an error, it should look like this:

<?php echo htmlspecialchars(exec("ps -A")); ?>

exec is more used than shell_exec and you don’t need so many semicolons.

1 Like