# Want to dump every SQL query Magento runs?

In: `lib/Zend/DB/Adapter/Adapter.php`

``````public function query(\$sql, \$bind = array())
{
// connect to the database if needed
\$this->_connect();

// is the \$sql a Zend_Db_Select object?
if (\$sql instanceof Zend_Db_Select) {
if (empty(\$bind)) {
\$bind = \$sql->getBind();
}

\$sql = \$sql->assemble();
}

\$time_start = microtime(true);

// make sure \$bind to an array;
// don't use (array) typecasting because
// because \$bind may be a Zend_Db_Expr object
if (!is_array(\$bind)) {
\$bind = array(\$bind);
}

// prepare and execute the statement with profiling
\$stmt = \$this->prepare(\$sql);
\$stmt->execute(\$bind);

// return the results embedded in the prepared statement object
\$stmt->setFetchMode(\$this->_fetchMode);

\$time_end = microtime(true);
\$time = \$time_end - \$time_start;

echo "SQL[\$time | \$sql ]" . "\n<br />\n";
return \$stmt;
}``````
{"ft_lang_label":"__label__en","ft_lang_prob":0.53173214,"math_prob":0.94003385,"size":817,"snap":"2023-14-2023-23","text_gpt3_token_len":221,"char_repetition_ratio":0.116851166,"word_repetition_ratio":0.0,"special_character_ratio":0.33047736,"punctuation_ratio":0.1484375,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9820324,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-03-29T18:40:55Z\",\"WARC-Record-ID\":\"<urn:uuid:1025d5ae-f04d-4dca-940c-f69b3c6fd00f>\",\"Content-Length\":\"37958\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:09c33982-b8ad-47a7-b9d6-6c71780741d8>\",\"WARC-Concurrent-To\":\"<urn:uuid:7298b4d9-3c73-4ab4-b656-27bf913b2c42>\",\"WARC-IP-Address\":\"104.198.14.52\",\"WARC-Target-URI\":\"https://timbroder.com/2010/12/want-to-dump-every-sql-query-magento-runs/\",\"WARC-Payload-Digest\":\"sha1:SZPB7PO6D4HCKVOI6QIFNDGOQEYI2RNN\",\"WARC-Block-Digest\":\"sha1:SJJUKSZBGB7VGQHLBRTV5KPQBWLWSBV5\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-14/CC-MAIN-2023-14_segments_1679296949025.18_warc_CC-MAIN-20230329182643-20230329212643-00405.warc.gz\"}"}