How to print Mysql query in WordPress ?
WP_Query function is used in WordPress to build query. This is very simple format of argument passing job to get required output. But while building complex query we may start to think “How can i see this query in Mysql format”.Is that possible ? Yes it is, Possible ! WordPress opens the
door even for that.Check below step to print the WP_Query function in Mysql format.
Step 1 : Define SAVEQUERIES as true in wp-config.php as bellow
define('SAVEQUERIES', true);
Step 2 : Place the below code in your footer section.
if (current_user_can('administrator')){ global $wpdb; print_r($wpdb->queries); }
That’s all just refresh your page, then see the printed Mysql query in array format.
Sniper Elite V2 [Online Game Code]