SqlProfiler is a project mainly written in PHP, it's free.
Passes Magento SQL statements via wildfire httpheaders to the client
The headers will only be sent if the firephp add-on for firefox is installed, cause it will modify the request header. This modification will be checked in lib/Zend/Wildfire/Channel/HttpHeaders.php in the function isReady().