Skip to content

Add a last_query() function to Database connection class. #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2012

Conversation

franzliedke
Copy link
Contributor

This simple helper function was suggested on IRC.

It allows you to easily fetch the last executed query.

@franzliedke
Copy link
Contributor Author

I signed off the second commit, hope that's enough.

taylorotwell added a commit that referenced this pull request Jun 3, 2012
Add a last_query() function to Database connection class.
@taylorotwell taylorotwell merged commit f608157 into laravel:develop Jun 3, 2012
@taylorotwell
Copy link
Member

Thanks!

@hasokeric
Copy link

i am using DB::last_query() but it seperately dumps the bindings which makes it impossible to just copy/paste into a SQL Editor... so the question is... how can i do DB::last_query() and get the string with all bindings in tact?

One might ask why? Because the Profiler doesnt work with Ajax well and also when you have a huge SQL Query its easier to copy it into Navicat or such and figure out the problem.

Ideas @franzliedke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants