# How to get last executed query in cakephp3

**URL:** <https://discourse.cakephp.org/t/how-to-get-last-executed-query-in-cakephp3/2650>\
**Category:** Need Help\
**Tags:** release\
**Created:** [June 1, 2017, 6:37am UTC](https://discourse.cakephp.org/t/how-to-get-last-executed-query-in-cakephp3/2650 "2017-06-01T06:37:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jyoti.srma6](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jyoti.srma6](https://discourse.cakephp.org/u/jyoti.srma6)\
**Post date:** [June 1, 2017, 6:37am UTC](https://discourse.cakephp.org/t/how-to-get-last-executed-query-in-cakephp3/2650/1 "2017-06-01T06:37:32Z")

</div>

Please help me to solve below queries on cakephp3

1. How can i get executed query in cakephp3 in case of save & delete. My requirement is to save query in database.

2. Is it possible to get the query inside any of callback function like eg. BeforeSave, AfterSave, AfterSaveCommit, BeforeDelete … etc.
