Get WordPress SQL query details
When I debug WordPress, getting SQL query details is useful in some situations.
In the WordPress plugin repo, we can find some nice debug plugins to get query details. Also, we can use default WordPress options to get query details.
First, we need to add a definition in our
The SAVEQUERIES definition saves the database queries to an array and we can use that array to analyze those queries.
The array is stored in the global
Print last SQL query string
Print last SQL query result
Print last SQL query Error
- Action hooks that trigger on, before or after add, update or delete actions of option - WordPress
- Get all variations of a variable product - WooCommerce
- Generate random string - Python
- Split domain from an email address - Python
- Get upcoming N days - PHP
Your Questions / Comments
If you found this article interesting, found errors, or just want to discuss about it, please get in touch.